Presentation is loading. Please wait.

Presentation is loading. Please wait.

PeopleSoft Instrumentation for Oracle RDBMS David Kurtz Go-Faster Consultancy Ltd.

Similar presentations


Presentation on theme: "PeopleSoft Instrumentation for Oracle RDBMS David Kurtz Go-Faster Consultancy Ltd."— Presentation transcript:

1 PeopleSoft Instrumentation for Oracle RDBMS David Kurtz Go-Faster Consultancy Ltd.

2 Who Am I? Oracle Database Specialist –Independent consultant Performance tuning –PeopleSoft ERP –Oracle RDBMS Book –www.psftdba.comwww.psftdba.com OakTable UKOUG Apps PeopleSoft Instrumentation for Oracle ©

3 Instrumentation Data! Data! Data! I can't make bricks without clay. The Adventures of Sherlock Holmes, Arthur Conan-Doyle UKOUG Apps PeopleSoft Instrumentation for Oracle ©

4 Instrumentation PeopleTools –SQL Trace –Batch Timings –Performance Monitor Oracle –Dynamic Performance Views (V$) –SQL Trace –Automatic Workload Repository (AWR) –Active Session History (ASH) UKOUG Apps PeopleSoft Instrumentation for Oracle ©

5 5 ASH: A Brief Overview Samples active sessions every second Circular buffer in memory –v$active_Session_history –It should hold about 1 hour of data 1 in 10 samples stored in database –DBA_HIST_ACTIVE_SESS_HISTORY –Flushed out during AWR snapshot UKOUG Apps PeopleSoft Instrumentation for Oracle

6 © Background Reading Sifting through the ASHes of (DB) TIme, Graham Wood pdfhttp://www.oracle.com/technetwork/database/manageability/ppt-active-session-history pdf –Video of presentation at MOW Doug Burns’ Oracle Blog –http://oracledoug.com/serendipity/index.php?/plugin/tag/ASHhttp://oracledoug.com/serendipity/index.php?/plugin/tag/ASH Practical ASH –http://www.go-faster.co.uk/ukougpres.htm#Practical_ASH.ppthttp://www.go-faster.co.uk/ukougpres.htm#Practical_ASH.ppt Introduction to DBMS_XPLAN –http://www.go-faster.co.uk/Intro_DBMS_XPLAN.ppthttp://www.go-faster.co.uk/Intro_DBMS_XPLAN.ppt UKOUG Apps PeopleSoft Instrumentation for Oracle

7 © What does ASH retain? Most of the columns are on v$session –Session Session ID and serial, query coordinator –Wait event id, name and parameters –SQL SQL_ID, plan hash, opcode, plan line –Object object, file, block and row numbers –Application module, action … UKOUG Apps PeopleSoft Instrumentation for Oracle

8 © ASH –v- SQL*Trace ASH –Licensed (Diagnostics) –Always there –Real Time –No marginal overhead –Who is blocking me? –Statistical data –SQL ID –Plan if captured by AWR –Estimate of duration Per wait event Per Plan Operation 11g SQL*Trace –Free –Enable, File, Profile –Reactive –Run-time overhead –Being Blocked –Every SQL & event –SQL HASH –Actual execution plan –Exact duration Operations in Plan UKOUG Apps PeopleSoft Instrumentation for Oracle

9 © ASH –v- SQL*Trace ASH can be used to resolve many of your performance issues. Sometimes, you will still need SQL*Trace UKOUG Apps PeopleSoft Instrumentation for Oracle

10 © Application Instrumentation It is essential to be able to match –database sessions –application processes DBMS_APPLICATION_INFO –set_module, set_action –Calls in application Introduced in PeopleTools –Appears in SQL*Trace and ASH UKOUG Apps PeopleSoft Instrumentation for Oracle

11 CLIENT_INFO –PeopleTools 7.53 –Every application server service calls DBMS_APPLICATION_INFO.SET_CLIENT_INFO V$SESSION.CLIENT_INFO Operator ID, … –Inserts into Audit tables can be done by database trigger. Trigger uses READ_CLIENT_INFO to obtain PeopleSoft OPRID –Not copied to ASH UKOUG Apps PeopleSoft Instrumentation for Oracle ©

12 CLIENT_ID PeopleTools 8.52 Also set to PeopleSoft OPRID. Client_ID is copied to ASH –So you can identify the PS operator UKOUG Apps PeopleSoft Instrumentation for Oracle ©

13 PIA Instrumentation PeopleTools 8.50 Module = Component Action = Page –Or XYZZY for search dialogue UKOUG Apps PeopleSoft Instrumentation for Oracle ©

14 IB Instrumentation PeopleTools 8.50 Module = Service Action = Queue UKOUG Apps PeopleSoft Instrumentation for Oracle ©

15 Application Engine PeopleTools 8.50 Module = ‘PSAE’ Action = Program –This is not good –See oracle-enterprise-manager-grid.htmlhttp://blog.psftdba.com/2009/03/using- oracle-enterprise-manager-grid.html UKOUG Apps PeopleSoft Instrumentation for Oracle ©

16 Application Engine PeopleTools 8.52 Module = ‘PSAE.’||AE program name||session id –session id is stored in PSPRCSQUE.SESSIONID_NUM Action = Program.Section.Step.Actions UKOUG Apps PeopleSoft Instrumentation for Oracle ©

17 Cobol / SQR No instrumentation DIY with trigger –on Process Scheduler request table –http://www.go- faster.co.uk/scripts.htm#psftapi.sqlhttp://www.go- faster.co.uk/scripts.htm#psftapi.sql UKOUG Apps PeopleSoft Instrumentation for Oracle ©

18 OEM UKOUG Apps PeopleSoft Instrumentation for Oracle ©

19 UKOUG Apps PeopleSoft Instrumentation for Oracle © ASH Report in OEM You can run ASH reports via EM –This example is for a specific module

20 Enable Trace by Module/Action Like setting a watchpoint in a debugger. See tracing-by-module-action.htmlhttp://blog.psftdba.com/2012/09/oracle-sql- tracing-by-module-action.html Can set SQL trace for a specific component/page. But you can’t predict the value of module for AE so may need to go back to the trigger based solution. UKOUG Apps PeopleSoft Instrumentation for Oracle ©

21 Ability to Profile SQL duration by Process/Process Instance PROGRAM MODULE ASH_SECS PSQRYSRV PSQRYSRV oracle oracle rman backup archivelog PSAESRV GL_JEDIT rman backup incr datafile FSPCCURR FSPCCURR PSAPPSRV VCHR_EXPRESS sum UKOUG Apps PeopleSoft Instrumentation for Oracle ©

22 Profile of Whole System WITH x AS ( SELECT /*+leading(x h) use_nl(h)*/ CASE WHEN h.module IS NULL THEN REGEXP_SUBSTR(h.program, WHEN h.module LIKE 'PSAE.%' THEN REGEXP_SUBSTR(h.module, '[^.]+',1,2) WHEN h.module LIKE '%.%' THEN REGEXP_SUBSTR(h.module, '[^.]+',1,1) WHEN h.module LIKE THEN REGEXP_SUBSTR(h.module, ELSE h.module END AS module, REGEXP_SUBSTR(h.program, program, h.event FROM dba_hist_snapshot x, dba_hist_active_sess_history h WHERE h.SNAP_id = X.SNAP_id AND h.dbid = x.dbid AND h.instance_number = x.instance_number AND x.end_interval_time >= TO_DATE(' ', 'YYYYMMDD') AND x.begin_interval_time <= TO_DATE(' ', 'YYYYMMDD') AND h.sample_time BETWEEN TO_DATE(' ','YYYYMMDD') AND TO_DATE(' ','YYYYMMDD') ) SELECT program, module, sum(10) ash_Secs FROM x GROUP BY program, module ORDER BY ash_secs DESC UKOUG Apps PeopleSoft Instrumentation for Oracle © ASH Data for period of interest Snapshots for Period of interest Logic to trim module name or.

23 Batch Timings by Exec Time UKOUG Apps PeopleSoft Instrumentation for Oracle ©

24 ASH Profile a Single Process Process SQL Plan Exec Instance SQL_ID Hash Value ACTION secs ASH_SECS fpj0dmac7rw AR_POSTING.HSS_PYMT.ITEMS.S qnfa4afzvj AR_POSTING.HS_PYMNT.ITEMS2.S u37a5hzzc2z AR_POSTING.HS_PYMNT.ITEMS.S grhj2f0dcbd AR_POSTING.HSS_DSO.BACK_OUT.S a6nrbg7sbx AR_POSTING.HSS_PYMT.UPD_STAT.S yzw3xa50r1t AR_POSTING.HS_USER.INSERTS.S wcx4syn7tjk AR_POSTING.HS_USER.UPDATES.S sjax92d6kqa AR_POSTING.HS_DSO.ADJ_BAL.S cm5xjajkfjvkg AR_POSTING.HSS_USR1.INSERTS.S djur79tkd6uum AR_POSTING.HS_USER.UPD_ACTV.S cb1cankq47ky AR_POSTING.HSS_USR1.UPDATES.S awa6cr95ug3t AR_POSTING.HS_PYMNT.UPD_STAT.S p8ga7kazdg AR_POSTING.HSS_USER.UPD_ACTV.S yrur2nv3nn2p AR_POSTING.HSS_DSO.NO_ACTIV.S UKOUG Apps PeopleSoft Instrumentation for Oracle ©

25 How profile a process (i) WITH x AS ( SELECT /*+LEADING(r q x h)*/ h.sql_id, h.sql_plan_hash_value, h.action, SUM(10) ash_secs, 10*count(t.sql_id) awr_secs FROM sysadm.psprcsrqst r, sysadm.psprcsque q, dbA_hist_snapshot x, dba_hist_active_Sess_history h LEFT OUTER JOIN dba_hist_sqltext t ON t.sql_id = h.sql_id WHERE x.END_INTERVAL_TIME >= r.begindttm AND x.begin_interval_time <= r.enddttm AND h.sample_time BETWEEN r.begindttm AND r.enddttm AND h.SNAP_id = X.SNAP_id AND h.dbid = x.dbid AND h.instance_number = x.instance_number AND q.prcsinstance = r.prcsinstance AND h.module = 'PSAE.'||r.prcsname||'.'||q.sessionidnum AND r.prcsname = 'AR_UPDATE2' AND r.prcsinstance = GROUP BY h.sql_id, h.sql_plan_hash_value, h.action) … UKOUG Apps PeopleSoft Instrumentation for Oracle © Process Request Table One Row per Process Process Request Queue Table One Row per Process Specific Process Request ASH data for period for which process was running Hint to guarantee sensible join order, and partition elimination Filter ASH data by module

26 How profile a process (ii) … ), y AS ( SELECT ROW_NUMBER() OVER (PARTITION BY x.sql_plan_hash_value order by x.awr_secs desc) as ranking, x.sql_id, x.sql_plan_hash_value, x.action, SUM(x.ash_secs) OVER (PARTITION BY x.sql_plan_hash_value) tot_ash_secs, SUM(x.awr_secs) OVER (PARTITION BY x.sql_plan_hash_value) tot_awr_secs, COUNT(distinct sql_id) OVER (PARTITION BY x.sql_plan_hash_value) sql_ids FROM x ) Select * from y where y.ranking = 1 AND tot_ash_secs > 30 ORDER BY tot_ash_secs DESC / UKOUG Apps PeopleSoft Instrumentation for Oracle © Ranking by SQL Plan Hash Value DB Time for Execution Plan AWR secs 0 if SQL not captured in ASH repository

27 Profile a Single Process Process SQL Plan Exec Instance SQL_ID Hash Value ACTION secs ASH_SECS fpj0dmac7rw AR_POSTING.HSS_PYMT.ITEMS.S qnfa4afzvj AR_POSTING.HS_PYMNT.ITEMS2.S u37a5hzzc2z AR_POSTING.HS_PYMNT.ITEMS.S grhj2f0dcbd AR_POSTING.HSS_DSO.BACK_OUT.S a6nrbg7sbx AR_POSTING.HSS_PYMT.UPD_STAT.S yzw3xa50r1t AR_POSTING.HS_USER.INSERTS.S wcx4syn7tjk AR_POSTING.HS_USER.UPDATES.S sjax92d6kqa AR_POSTING.HS_DSO.ADJ_BAL.S cm5xjajkfjvkg AR_POSTING.HSS_USR1.INSERTS.S djur79tkd6uum AR_POSTING.HS_USER.UPD_ACTV.S cb1cankq47ky AR_POSTING.HSS_USR1.UPDATES.S awa6cr95ug3t AR_POSTING.HS_PYMNT.UPD_STAT.S p8ga7kazdg AR_POSTING.HSS_USER.UPD_ACTV.S yrur2nv3nn2p AR_POSTING.HSS_DSO.NO_ACTIV.S UKOUG Apps PeopleSoft Instrumentation for Oracle ©

28 Now investigate the SQL Extract SQL from AWR repository with the dbms_xplan package –Obtaining and Interpreting Execution Plans using DBMS_XPLANObtaining and Interpreting Execution Plans using DBMS_XPLAN faster.co.uk/ukougpres.htm#Intro_DBMS_XPLANhttp://www.go- faster.co.uk/ukougpres.htm#Intro_DBMS_XPLAN UKOUG Apps PeopleSoft Instrumentation for Oracle ©

29 SELECT * FROM table( dbms_xplan.display_awr( 'duu7n4uzsthxz', ,NULL,'ADVANCED')); SQL_ID duu7n4uzsthxz INSERT INTO PS_HS_CLSITM_TMP4 (…) SELECT , I.BUSINESS_UNIT,… FROM PS_ITEM I,PS_ITEM_ACTIVITY A,PS_POST_REQ_TMP4 R WHERE R.PROCESS_INSTANCE = AND R.PROCESS_P_HIST ='Y' -- AND I.BUSINESS_UNIT = R.BUSINESS_UNIT AND I.ITEM_STATUS = 'C' AND I.HIST_STATUS = 'N' -- AND A.BUSINESS_UNIT = I.BUSINESS_UNIT AND A.CUST_ID = I.CUST_ID AND A.ITEM = I.ITEM AND A.ITEM_LINE = I.ITEM_LINE AND A.ENTRY_TYPE = I.ENTRY_TYPE AND A.ENTRY_REASON = I.ENTRY_REASON AND A.ITEM_SEQ_NUM = ( SELECT MIN(ITEM_SEQ_NUM) FROM PS_ITEM_ACTIVITY X WHERE X.BUSINESS_UNIT = I.BUSINESS_UNIT AND X.CUST_ID = I.CUST_ID AND X.ITEM = I.ITEM AND X.ITEM_LINE = I.ITEM_LINE AND X.ENTRY_TYPE = I.ENTRY_TYPE AND X.ENTRY_REASON = I.ENTRY_REASON) AND A.ENTRY_AMT_BASE > 0 UKOUG Apps PeopleSoft Instrumentation for Oracle ©

30 Execution Plan Plan hash value: | Id | Operation | Name | Rows | Bytes |TempSpc| Cost (%CPU)| Time | | 0 | INSERT STATEMENT | | | | | 222K(100)| | | 1 | FILTER | | | | | | | | 2 | HASH JOIN | | | 3613K| | 111K (1)| 00:22:19 | | 3 | TABLE ACCESS BY INDEX ROWID | PS_POST_REQ_TMP4 | 8 | 112 | | 2 (0)| 00:00:01 | | 4 | INDEX RANGE SCAN | PS_POST_REQ_TMP4 | 8 | | | 1 (0)| 00:00:01 | | 5 | HASH JOIN | | | 3289K| 11M| 111K (1)| 00:22:19 | | 6 | TABLE ACCESS BY INDEX ROWID| PS_ITEM | 118K| 9944K| | (1)| 00:06:04 | | 7 | INDEX RANGE SCAN | PSKITEM | 280K| | | 812 (1)| 00:00:10 | | 8 | TABLE ACCESS FULL | PS_ITEM_ACTIVITY | 3480K| 185M| | (1)| 00:13:33 | | 9 | SORT AGGREGATE | | 1 | 42 | | | | | 10 | TABLE ACCESS BY INDEX ROWID | PS_ITEM_ACTIVITY | 1 | 42 | | 5 (0)| 00:00:01 | | 11 | INDEX RANGE SCAN | PS_ITEM_ACTIVITY | 1 | | | 4 (0)| 00:00:01 | Query Block Name / Object Alias (identified by operation id): SEL$1 3 - SEL$1 / 4 - SEL$1 / 6 - SEL$1 / 7 - SEL$1 / 8 - SEL$1 / 9 - SEL$ SEL$2 / 11 - SEL$2 / Outline Data /*+ BEGIN_OUTLINE_DATA IGNORE_OPTIM_EMBEDDED_HINTS OPTIMIZER_FEATURES_ENABLE(' ') OPT_PARAM('_unnest_subquery' 'false') OPT_PARAM('optimizer_dynamic_sampling' 4) OPT_PARAM('_optimizer_cost_based_transformation' 'off') ALL_ROWS ("PS_ITEM"."HIST_STATUS")) ("PS_POST_REQ_TMP4"."PROCESS_INSTANCE" "PS_POST_REQ_TMP4"."BUSINESS_UNIT")) ("PS_ITEM_ACTIVITY"."BUSINESS_UNIT" "PS_ITEM_ACTIVITY"."CUST_ID" "PS_ITEM_ACTIVITY"."ITEM" "PS_ITEM_ACTIVITY"."ITEM_LINE" "PS_ITEM_ACTIVITY"."ITEM_SEQ_NUM")) END_OUTLINE_DATA */ Note dynamic sampling used for this statement UKOUG Apps PeopleSoft Instrumentation for Oracle ©

31 Limitations SQL may not be captured by AWR –SQL inside a loop –With bind variables –Without ReUseStatement (binds become literals) Increase AWR snapshot frequency –15 minutes instead of an hour –Top N SQL threshold UKOUG Apps PeopleSoft Instrumentation for Oracle ©

32 Conclusion Instrumentation permits you to profile DB performance with ASH Proactively address performance issues UKOUG Apps PeopleSoft Instrumentation for Oracle ©

33 QUESTIONS? Nullius in verba UKOUG Apps PeopleSoft Instrumentation for Oracle ©

34 You know my methods, apply them. A Study in Scarlet, Arthur Conan-Doyle UKOUG Apps PeopleSoft Instrumentation for Oracle ©

35 PeopleSoft Instrumentation for Oracle RDBMS David Kurtz Go-Faster Consultancy Ltd.


Download ppt "PeopleSoft Instrumentation for Oracle RDBMS David Kurtz Go-Faster Consultancy Ltd."

Similar presentations


Ads by Google