Created
September 24, 2014 15:42
-
-
Save davidhooey/4f7c96393f5cdbcae427 to your computer and use it in GitHub Desktop.
Oracle Which SQL_ID Caused A Particular Wait Event
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
select | |
event, | |
sql_id, | |
snap_id, | |
dbid, | |
instance_number, | |
sample_time, | |
session_id, | |
session_serial#, | |
user_id, | |
blocking_session, | |
program, | |
( | |
select | |
sql_text | |
from | |
dba_hist_sqltext | |
where | |
sql_id = dba_hist_active_sess_history.sql_id | |
) sql_text | |
from | |
dba_hist_active_sess_history | |
where | |
program = 'some.exe' | |
and | |
sample_time between | |
to_timestamp('START_TIME', 'YYYY-MM-DD HH24:MI:SS.FF3') and | |
to_timestamp('END_TIME', 'YYYY-MM-DD HH24:MI:SS.FF3') | |
and | |
event = 'some wait event' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment