Thursday, May 19, 2011

Lock details

SELECT NVL(S.USERNAME,'INTERNAL') USERNAME,
NVL(S.TERMINAL,'NONE') TERMINAL,L.SID || ',' || S.SERIAL# KILL,
U1.NAME|| '.' || SUBSTR(T1.NAME,1,20) TA_BLE,
DECODE(L.LMODE,1, 'NO LOCK',2,'ROW SHARE',3,'ROW EXCLUSIVE',
4,'SHARE',5,'SHARE ROW EXCLUSIVE',6,'EXCLUSIVE',NULL) LMODE,
DECODE(L.REQUEST,1,'NO LOCK',2,'ROW SHARE',3,'ROW EXCLUSIVE',
4,'SHARE',5,'SHARE ROW EXCLUSIVE',6,'EXLUSIVE',NULL) REQUEST,
S.LOGON_TIME
FROM V$LOCK L,V$SESSION S,SYS.USER$ U1,SYS.OBJ$ T1
WHERE L.SID=S.SID
AND T1.OBJ#=DECODE(L.ID2,0,L.ID1,L.ID2)
AND U1.USER# = T1.OWNER#
AND S.TYPE != 'BACKGROUND'
ORDER BY 6,1,2,5;

No comments: