oracle locked objects

Solutions on MaxInterview for oracle locked objects by the best coders in the world

showing results for - "oracle locked objects"
Alberto
15 Jul 2018
1SELECT (SELECT USERNAME FROM v$session WHERE SID = a.SID) AS blocker,
2       a. SID,
3       ' is blocking ',
4       (SELECT USERNAME FROM v$session WHERE SID = b. SID) AS blockee,
5       b. SID
6FROM v$lock a,
7     v$lock b
8WHERE a.BLOCK = 1 AND b.REQUEST > 0 AND a.ID1 = b.ID1 AND a.ID2 = b.ID2;
Irene
03 Aug 2016
1-- Oracle: Locked objects
2SELECT vs.USERNAME, vs.OSUSER, vh.SID LOCKING_SID, vs.STATUS STATUS,
3       vs.MODULE MODULE, vs.PROGRAM PROGRAM_HOLDING, jrh.JOB_NAME, vsw.USERNAME,
4       vsw.OSUSER, vw.SID WAITER_SID, vsw.PROGRAM PROGRAM_WAITING, jrw.JOB_NAME
5FROM V$LOCK vh,
6     V$LOCK vw,
7     V$SESSION vs,
8     V$SESSION vsw,
9     DBA_SCHEDULER_RUNNING_JOBS jrh,
10     DBA_SCHEDULER_RUNNING_JOBS jrw
11WHERE (vh.ID1,
12       vh.ID2) IN (
13          SELECT ID1, ID2
14          FROM V$LOCK
15          WHERE REQUEST = 0
16          INTERSECT
17          SELECT ID1, ID2
18          FROM V$LOCK
19          WHERE LMODE = 0
20      )
21  AND vh.ID1 = vw.ID1
22  AND vh.ID2 = vw.ID2
23  AND vh.REQUEST = 0
24  AND vw.LMODE = 0
25  AND vh.SID = vs.SID
26  AND vw.SID = vsw.SID
27  AND vh.SID = jrh.SESSION_ID (+)
28  AND vw.SID = jrw.SESSION_ID (+);