|
| 1 | +rem Script displays some informations that may be helpfull to analyze slow running RAT-Replays |
| 2 | +rem See also MOS-Note 760402.1 |
| 3 | + |
| 4 | +set echo on |
| 5 | +set verify off |
| 6 | +set pagesize 200 |
| 7 | + |
| 8 | +set lines 500 trimspool on pages 60 |
| 9 | +spool debug_replay.txt |
| 10 | + |
| 11 | +col filter_set_name format a30 |
| 12 | +col default_action format a20 |
| 13 | +col synchronization format a10 |
| 14 | +col connect_time_scale format 99999 heading "CONNECT|TIME|SCALE" |
| 15 | +col think_time_scale format 999999 heading "THINK|TIME|SCALE" |
| 16 | +col think_time_auto_correct format a8 heading " THINK| TIME| AUTO|CORRECT" |
| 17 | +col scale_up_multiplier format 99999 heading "SCALE|UP|MULTIPLIER" |
| 18 | +col start_time format a18 |
| 19 | +col end_time format a18 |
| 20 | + |
| 21 | +REM Replay Parameter |
| 22 | + |
| 23 | +select id repl, to_char(start_time,'DD-Mon HH24:MI:SS') start_time, to_char( end_time,'DD-Mon HH24:MI:SS') end_time, |
| 24 | + duration_secs, filter_set_namE, default_action, synchronization, |
| 25 | + connect_time_scale, think_time_scale, think_time_auto_correct, scale_up_multiplier |
| 26 | +-- , think_time, elapsed_time_diff |
| 27 | +from dba_workload_replays |
| 28 | +where id = (select max(id) |
| 29 | + from dba_workload_replays) |
| 30 | +/ |
| 31 | + |
| 32 | +col capture_id format 9999 |
| 33 | +col replay_id format 9999 |
| 34 | +col start_time format a21 |
| 35 | +col end_time format a21 |
| 36 | +col current_time format a21 |
| 37 | +col directory_path format a38 |
| 38 | +col "% replayed" format 990.00 |
| 39 | +col status format a15 |
| 40 | +col r_dbtime_sec format 999G999G990D00 |
| 41 | +col c_dbtime_sec format 999G999G990D00 |
| 42 | +col repl_user_calls format 999G999G999G999 |
| 43 | +col capt_user_calls format 999G999G999G999 |
| 44 | +col capt_calls_total format 999G999G999G999 |
| 45 | +col c_unreplayable format 999G999G999G999 |
| 46 | +col repl_id format 99999 |
| 47 | +col capt_id format 99999 |
| 48 | +col begin_snap format 999999 heading "BEGIN|SNAP" |
| 49 | +col end_snap format 999999 heading "END|SNAP" |
| 50 | +col status format a15 |
| 51 | +col "#Clients" format 99999999 |
| 52 | +col Real_Time_Repl_Capture format a17 heading "Real-Time Repl/Capt" |
| 53 | +col DB_Time_Repl_Capture format 999G999D00 heading "% DB-Time Repl/Capt" |
| 54 | +col "%Calls repl'd" format 9990D00 Heading "%Calls|repl'd" |
| 55 | +col "% Replaytime" format 99G990D00 heading "% Replay|time" |
| 56 | +col "% Divergences" format 990D00 |
| 57 | +col "User Calls" format 999G999G999G999G999 |
| 58 | +col "Replay Divergences" format 999G999G999G999G999 |
| 59 | +col max_repl_id new_value max_repl_id heading id |
| 60 | +col id format 9999 |
| 61 | +col repl format 9999REM Replay Progress |
| 62 | + |
| 63 | +select r.id repl, r.capture_id capt, |
| 64 | + r.status, |
| 65 | + -- r.name, |
| 66 | + r.awr_begin_snap begin_snap, r.awr_end_snap end_snap, r.num_clients "#Clients" , |
| 67 | +lpad(trunc((nvl(r.end_time,sysdate) - r.start_time) * (24 * 60 * 60)/3600),2,'0') ||':'|| lpad(trunc(mod((nvl(r.end_time,sysdate) - r.start_time) * (24 * 60 * 60),3600) / 60 ),2,'0') ||':'||lpad(mod((nvl(r.end_time,sysdate) - r.start_time) * (24 * 60 * 60),60),2,'0') |
| 68 | +|| '/' || |
| 69 | +lpad(trunc((nvl(c.end_time,sysdate) - c.start_time) * (24 * 60 * 60)/3600),2,'0') ||':'|| lpad(trunc(mod((nvl(c.end_time,sysdate) - c.start_time) * (24 * 60 * 60),3600) / 60 ),2,'0') ||':'||lpad(mod((nvl(c.end_time,sysdate) - c.start_time) * (24 * 60 * 60),60),2,'0') "Real_Time_Repl_Capt" , |
| 70 | + round(r.user_calls / (c.user_calls) * 100,2) "%Calls repl'd", |
| 71 | + round( (nvl(r.end_time,sysdate) - r.start_time) / |
| 72 | + (nvl(c.end_time,sysdate) - c.start_time )* 100,3) "% Replaytime", |
| 73 | + r.USER_CALLS repL_user_calls, c.user_calls capt_user_calls, |
| 74 | + c.user_calls_total capt_calls_total, |
| 75 | + c.user_calls_unreplayable c_unreplayable, |
| 76 | + round((r.dbtime / c.dbtime * 100),2) "DB_Time_Repl_Capture" |
| 77 | + --, elapsed_time_diff, elapsed_time_diff / (1000 * 1000) ela_diff_sec |
| 78 | +from dba_workload_replays r , dba_workload_captures c |
| 79 | +where c.id = r.capture_id |
| 80 | +and r.id = (select max(id) from dba_workload_replays) |
| 81 | +/ |
| 82 | + |
| 83 | +REM Query to Obtain Information on Blocking Sessions with gv$workload_replay_thread |
| 84 | + |
| 85 | +col inst_id format 99999 |
| 86 | +col sid format 99999 |
| 87 | +col spid format a6 |
| 88 | +col blocking_session_status format a15 heading 'BS' |
| 89 | +col blocking_instance format 99 heading 'BI' |
| 90 | +col blocking_session format 99999 heading 'BLKSID' |
| 91 | +col session_type format a11 |
| 92 | +col event format a31 |
| 93 | +col file_name format a21 |
| 94 | +col file_id format 9999999999999999999 |
| 95 | +col call_counter format 9999999 |
| 96 | +col wait_for_scn format 99999999999999 heading 'WAITING FOR' |
| 97 | +col wfscn format 99999999999999 heading 'WFSCN' |
| 98 | +col commit_wait_scn format 99999999999999 heading 'CWSCN' |
| 99 | +col post_commit_scn format 99999999999999 heading 'PCSCN' |
| 100 | +col clock format 99999999999999999999 heading 'CLOCK' |
| 101 | +col next_ticker format 999999999999999999999 heading 'NEXT TICKER' |
| 102 | + |
| 103 | +select wrt.inst_id, wrt.sid, wrt.serial#, wrt.spid, |
| 104 | +s.BLOCKING_SESSION_STATUS, s.BLOCKING_INSTANCE, |
| 105 | +s.blocking_session, |
| 106 | +wrt.session_type, wrt.event, |
| 107 | +wrt.file_name, wrt.file_id, wrt.call_counter, |
| 108 | +wrt.wait_for_scn, |
| 109 | +greatest(wrt.dependent_scn, wrt.statement_scn) as wfscn, |
| 110 | +wrt.commit_wait_scn, wrt.post_commit_scn, |
| 111 | +wrt.clock, wrt.next_ticker |
| 112 | +from gv$workload_replay_thread wrt, gv$session s |
| 113 | +where wrt.sid = s.sid |
| 114 | +and wrt.serial# = s.serial# |
| 115 | +order by inst_id, sid |
| 116 | +/ |
| 117 | +spool off |
| 118 | + |
| 119 | +col repl_id format 9999999 |
| 120 | +col capt format 9999 |
| 121 | +col "Real_Time_Repl_Capt" format a20 |
0 commit comments