Thursday, January 18, 2018

How to check blocking session in database

Query:
=====================

set lines 300 pages 3000
col MACHINE for a25
col USERNAME for a12
col EVENT for a30
col OSUSER for a10
col INST_ID for 9999999

select INST_ID,sid,osuser,username,MACHINE,sql_id,event, last_call_et RUN_TIME,seconds_in_wait Wait_time,blocking_session B_S,blocking_instance B_I
from gv$session
where
blocking_session is not NULL and event not like '%PX Deq%' and event not like '%read by other%' order by blocking_session;


To find Final Blocking session use below query:
======================================

select distinct FINAL_BLOCKING_SESSION from v$session where  FINAL_BLOCKING_SESSION_STATUS='VALID';


No comments:

Post a Comment