1.
SELECT SID, DECODE(BLOCK, 0, ''NO'', ''YES'' ) BLOCKER, DECODE(REQUEST, 0, ''NO'',''YES'' ) WAITER
FROM V$LOCK
WHERE REQUEST > 0 OR BLOCK > 0
ORDER BY block DESC;
2.
SELECT bs.username "Blocking User", bs.username "DB User",
ws.username "Waiting User", bs.sid "SID", ws.sid "WSID",
bs.serial# "Serial#", bs.sql_address "address",
bs.sql_hash_value "Sql hash", bs.program "Blocking App",
ws.program "Waiting App", bs.machine "Blocking Machine",
ws.machine "Waiting Machine", bs.osuser "Blocking OS User",
ws.osuser "Waiting OS User", bs.serial# "Serial#",
ws.serial# "WSerial#",
DECODE (wk.TYPE,
''MR'', ''Media Recovery'',
''RT'', ''Redo Thread'',
''UN'', ''USER Name'',
''TX'', ''Transaction'',
''TM'', ''DML'',
''UL'', ''PL/SQL USER LOCK'',
''DX'',
''Distributed Xaction'',
''CF'', ''Control FILE'',
''IS'', ''Instance State'',
''FS'', ''FILE SET'',
''IR'', ''Instance Recovery'',
''ST'', ''Disk SPACE Transaction'',
''TS'', ''Temp Segment'',
''IV'', ''Library Cache Invalidation'',
''LS'', ''LOG START OR Switch'',
''RW'', ''ROW Wait'',
''SQ'', ''Sequence Number'',
''TE'', ''Extend TABLE'',
''TT'', ''Temp TABLE'',
wk.TYPE
) lock_type,
DECODE (hk.lmode,
0, ''None'',
1, ''NULL'',
2, ''ROW-S (SS)'',
/* This lock blocks other processes */