Saturday, June 6, 2009

Blocking Sessions

SELECT  DECODE(A.REQUEST,0,'HOLDER: ', 'WAITER: ')||A.SID SESS,
A.ID1, A.ID2, A.LMODE, A.REQUEST, A.TYPE FROM V$LOCK A
WHERE (A.ID1, A.ID2, A.TYPE)
IN (SELECT C.ID1, C.ID2, C.TYPE FROM V$LOCK C WHERE C.REQUEST>0)
ORDER BY A.ID1,A.REQUEST;


SELECT SID,SERIAL# FROM V$SESSION WHERE SID IN (
SELECT A.SID FROM V$LOCK A
WHERE (A.ID1, A.ID2, A.TYPE)
IN (SELECT C.ID1, C.ID2, C.TYPE FROM V$LOCK C WHERE C.REQUEST>0)
ORDER BY A.ID1,A.REQUEST);

No comments:

Post a Comment