select * from v$locked_object ;
以下的語法可以依型別差看,不過有點難看不懂
SELECT S.SID SESSION_ID, S.USERNAME,
DECODE(LMODE, 0, 'None', 1, 'Null', 2, 'Row-S (SS)', 3, 'Row-X (SX)', 4, 'Share', 5, 'S/Row-X (SSX)', 6, 'Exclusive', TO_CHAR(LMODE)) MODE_HELD,
DECODE(REQUEST, 0, 'None', 1, 'Null', 2, 'Row-S (SS)', 3, 'Row-X (SX)', 4, 'Share', 5, 'S/Row-X (SSX)', 6, 'Exclusive', TO_CHAR(REQUEST)) MODE_REQUESTED,
O.OBJECT_NAME,O.OBJECT_TYPE,
S.TYPE LOCK_TYPE, L.ID1 LOCK_ID1, L.ID2 LOCK_ID2
FROM V$LOCK L, SYS.DBA_OBJECTS O, V$SESSION S
WHERE L.SID = S.SID AND L.ID1 = O.OBJECT_ID ;
用此語法配合提示可告訴User目前被誰Hold住,暫時不建議操作
SELECT osuser,machine,sql_text FROM v$open_cursor a, v$session s
WHERE s.sid=a.sid and a.sql_text LIKE '%語法%'
沒有留言:
張貼留言