Below are the useful script for DBA to get historical
blocking and locking session in the database
SELECT distinct a.sql_id ,a.inst_id, a.blocking_session,a.blocking_session_serial#,a.user_id,s.sql_text,a.module
FROM GV$ACTIVE_SESSION_HISTORY a ,gv$sql s
where a.sql_id=s.sql_id
and blocking_session is not null
and a.user_id <> 0
and a.sample_time > sysdate-11;
SELECT distinct a.sql_id,
a.blocking_session,a.blocking_session_serial#,
a.user_id,s.sql_text,a.module
FROM V$ACTIVE_SESSION_HISTORY a, v$sql s
where a.sql_id=s.sql_id
and blocking_session is not null
and a.user_id <> 0
and a.sample_time between to_date('08/01/2018 17:00', 'dd/mm/yyyy
hh24:mi')
and to_date('08/01/2018 17:30', 'dd/mm/yyyy hh24:mi');
Yes it's helpful
ReplyDeleteThanks sb for your feedback.
Delete