Andre Spadini
André Spadini | MultiCloud | DBA

André Spadini | MultiCloud | DBA

Oracle: Identificando locks

Oracle: Identificando locks

Andre Spadini's photo
Andre Spadini

Published on Aug 23, 2021

1 min read

Subscribe to my newsletter and never miss my upcoming articles

sql>  
col blocker format a30;
col blockee format a30;
select 
   (select username from v$session where sid=a.sid) blocker,
   a.sid,
   ' is blocking ',
   (select username from v$session where sid=b.sid) blockee,
   b.sid
from 
   v$lock a, 
   v$lock b
where 
   a.block = 1
and 
   b.request > 0
and 
   a.id1 = b.id1
and 
   a.id2 = b.id2;




BLOCKER                               SID 'ISBLOCKING'  BLOCKEE                               SID
------------------------------ ---------- ------------- ------------------------------ ----------
SAPIENS                               594  is blocking  SAPIENS
 
Share this