First
determine the snapshot id values for the period in question.
In
this example we need to find the SNAP_ID for the period 10 PM to 11 PM on the
30th of March, 2016.
select snap_id,begin_interval_time,end_interval_time
from dba_hist_snapshot
where to_char(begin_interval_time,’DD-MON-YYYY’)=’30-Mar-2016′
and EXTRACT(HOUR FROM begin_interval_time) between 22 and 23;
set verify off
select * from (
select active_session_history.event,
sum(active_session_history.wait_time +
active_session_history.time_waited) ttl_wait_time
from dba_hist_active_sess_history active_session_history
where event is not null
and SNAP_ID between &ssnapid and &esnapid
group by active_session_history.event
order by 2 desc)
where rownum
from dba_hist_snapshot
where to_char(begin_interval_time,’DD-MON-YYYY’)=’30-Mar-2016′
and EXTRACT(HOUR FROM begin_interval_time) between 22 and 23;
set verify off
select * from (
select active_session_history.event,
sum(active_session_history.wait_time +
active_session_history.time_waited) ttl_wait_time
from dba_hist_active_sess_history active_session_history
where event is not null
and SNAP_ID between &ssnapid and &esnapid
group by active_session_history.event
order by 2 desc)
where rownum
Do you like this post? Please share this article.
HTML Link Code:
1 comments:
Very Helpful... Keep it up....
ReplyPost a Comment