COLUMN sid FORMAT 999 HEADING "Sess|ID "
COLUMN object_name FORMAT A17 HEADING "OBJ Name or|Trans ID" TRUNC
COLUMN terminal FORMAT A8 TRUNC
COLUMN osuser FORMAT A10 HEADING "OP Sys|User ID"
COLUMN username FORMAT A8
SELECT B.sid, C.serial#, C.username, C.osuser, C.terminal,
DECODE(B.id2, 0, A.object_name, 'Trans-' || TO_CHAR(B.id1)) object_name,
B.type,
DECODE(B.lmode,
0, '--Waiting--',
1, 'Null',
2, 'Row Share',
3, 'Row Excl',
4, 'Share',
5, 'Share Row Excl',
6, 'Exclusive', 'Other') "Lock Mode",
DECODE(B.request,
0, ' ',
1, 'Null',
2, 'Row Share',
3, 'Row Excl',
4, 'Share',
5, 'Share Row Excl',
6, 'Exclusive', 'Other') "Req Mode"
FROM dba_objects A, v$lock B, v$session C
WHERE (A.object_id(+) = B.id1 AND
B.sid = C.sid AND
C.username IS NOT NULL)
ORDER BY B.sid, B.id2;
COLUMN object_name FORMAT A17 HEADING "OBJ Name or|Trans ID" TRUNC
COLUMN terminal FORMAT A8 TRUNC
COLUMN osuser FORMAT A10 HEADING "OP Sys|User ID"
COLUMN username FORMAT A8
SELECT B.sid, C.serial#, C.username, C.osuser, C.terminal,
DECODE(B.id2, 0, A.object_name, 'Trans-' || TO_CHAR(B.id1)) object_name,
B.type,
DECODE(B.lmode,
0, '--Waiting--',
1, 'Null',
2, 'Row Share',
3, 'Row Excl',
4, 'Share',
5, 'Share Row Excl',
6, 'Exclusive', 'Other') "Lock Mode",
DECODE(B.request,
0, ' ',
1, 'Null',
2, 'Row Share',
3, 'Row Excl',
4, 'Share',
5, 'Share Row Excl',
6, 'Exclusive', 'Other') "Req Mode"
FROM dba_objects A, v$lock B, v$session C
WHERE (A.object_id(+) = B.id1 AND
B.sid = C.sid AND
C.username IS NOT NULL)
ORDER BY B.sid, B.id2;
Comentários
Postar um comentário