locked tables in oracle

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

showing results for - "locked tables in oracle"
Lotta
17 Oct 2020
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 (+);