Created
September 24, 2014 15:31
-
-
Save davidhooey/d67befdcf2fdce351320 to your computer and use it in GitHub Desktop.
Oracle Wait Events for SQL_ID within Specific Time Frame
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- V$ACTIVE_SESSION_HISTORY | |
select | |
event, | |
sum(time_waited) time_waited | |
from | |
v$active_session_history | |
where | |
sql_id = 'SQL_ID' | |
and | |
sample_time between | |
to_timestamp('START_TIMESTAMP', 'YYYY-MM-DD HH24:MI:SS.FF3') and | |
to_timestamp('END_TIMESTAMP', 'YYYY-MM-DD HH24:MI:SS.FF3') | |
group by | |
event | |
order by | |
time_waited desc; | |
-- DBA_HIST_SESS_HISTORY | |
select | |
event, | |
sum(time_waited) time_waited | |
from | |
dba_hist_active_sess_history | |
where | |
sql_id = 'SQL_ID' | |
and | |
sample_time between | |
to_timestamp('START_TIMESTAMP', 'YYYY-MM-DD HH24:MI:SS.FF3') and | |
to_timestamp('END_TIMESTAMP', 'YYYY-MM-DD HH24:MI:SS.FF3') | |
group by | |
event | |
order by | |
time_waited desc; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment