Cheeky Cockatoo

Life Advice and Stories, Travel, Oracle Tech, Good Food and More

blocker.sql

Download Script

break on rs skip 1
col uname for a15
col os for a10
select distinct c.username uname, c.osuser os, a.ADDR, a.SID, c.serial#, 
       a.id1 rs, decode(a.LMODE,6,'BLOCKER',0,'WAITER') status
from v$lock a, v$lock b, v$session c
where a.type = 'TX'
and a.sid=c.sid
and a.id1 = b.id1
and ((a.lmode=6 and b.request=6) or (a.request=6 and b.lmode=6))
order by 6, 7, 5;