Thursday, 11 September 2014

Top CPU Consuming SQL During A Certain Time Period




select * from (
select SQL_ID,  sum(CPU_TIME_DELTA), sum(DISK_READS_DELTA),
count(*) from DBA_HIST_SQLSTAT a, dba_hist_snapshot s
where
s.snap_id = a.snap_id
and s.begin_interval_time > sysdate -1
and EXTRACT(HOUR FROM S.END_INTERVAL_TIME) between 9 and 11
group by SQL_ID
order by sum(CPU_TIME_DELTA) desc)
where rownum < 10;

No comments:

Post a Comment