selects1.h_date,trunc(s1.v_avg,2) pyh_reads,trunc(s2.v_avg,2) dir_reads,trunc(s1.mb_sec,2) pyh_mb_s,trunc(s2.mb_sec,2) dir_mb_s,trunc((s2.v_avg/s1.v_avg)*100,2) R_PCTfrom--S1-B-----------(selecttrunc(b_snap_date,'HH') h_date,sum(snap_value) svalue,sum(snap_value/snap_secs) v_avg,sum(snap_value/snap_secs)*v_db_block_size/1024/1024 mb_secfrom(selects.INSTANCE_NUMBER,cast (s.END_INTERVAL_TIME as date) e_snap_date,cast (s.BEGIN_INTERVAL_TIME as date) b_snap_date,(cast(s.END_INTERVAL_TIME as date) - cast(s.BEGIN_INTERVAL_TIME as date))*24*60*60 snap_secs,t.VALUE,(t.VALUE-LAG (t.VALUE) OVER (ORDER BY s.INSTANCE_NUMBER, s.BEGIN_INTERVAL_TIME)) snap_valuefromDBA_HIST_SNAPSHOT s,DBA_HIST_SYSSTAT twhere 1=1and s.SNAP_ID = t.SNAP_IDand s.DBID = t.DBIDand s.INSTANCE_NUMBER = t.INSTANCE_NUMBERand s.DBID = (select DBID from V$DATABASE)and t.STAT_NAME = 'physical reads') pr,(select VALUE v_db_block_size from v$parameter where name = 'db_block_size')where snap_value > 0group by trunc(b_snap_date,'HH'),v_db_block_size) S1,--S2-B-----------(selecttrunc(b_snap_date,'HH') h_date,sum(snap_value) svalue,sum(snap_value/snap_secs) v_avg,sum(snap_value/snap_secs)*v_db_block_size/1024/1024 mb_secfrom(selects.INSTANCE_NUMBER,cast (s.END_INTERVAL_TIME as date) e_snap_date,cast (s.BEGIN_INTERVAL_TIME as date) b_snap_date,(cast(s.END_INTERVAL_TIME as date) - cast(s.BEGIN_INTERVAL_TIME as date))*24*60*60 snap_secs,t.VALUE,(t.VALUE-LAG (t.VALUE) OVER (ORDER BY s.INSTANCE_NUMBER, s.BEGIN_INTERVAL_TIME)) snap_valuefromDBA_HIST_SNAPSHOT s,DBA_HIST_SYSSTAT twhere 1=1and s.SNAP_ID = t.SNAP_IDand s.DBID = t.DBIDand s.INSTANCE_NUMBER = t.INSTANCE_NUMBERand s.DBID = (select DBID from V$DATABASE)and t.STAT_NAME = 'physical reads direct') pr,(select VALUE v_db_block_size from v$parameter where name = 'db_block_size')where snap_value > 0group by trunc(b_snap_date,'HH'),v_db_block_size) S2--S2-E-----------where 1=1and s1.h_date = s2.h_date (+)order bys1.h_date;
Tuesday, July 9, 2013
Oracle PT (11203) Hourly based comparison between Physical reads and Direct Reads
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment