Thursday, February 7, 2019

Determine lock whether table lock or row lock

select s.sid,
       s.username,
       decode(l.type,'TM','TABLE LOCK','TX','ROW LOCK',NULL) LOCK_LEVEL,
       o.owner,
       o.object_name,
       o.object_type,
       o.object_id,
       l.LMODE,
       l.ID1,
       l.ID2,
       l.REQUEST,
       l.ctime  -- Time (seconds) since current mode was granted
from v$session s,v$lock l,dba_objects o
where l.sid= s.sid
and l.id1=o.object_id(+)
and s.username not in ('SYS','SYSTEM')
order by s.sid,LOCK_LEVEL, o.object_name;

No comments:

Post a Comment