Get current locks:
SQL> select s.username "Session User",
l.sid "Lock Session",
l.type "Lock Type",
DECODE(l.lmode, 0, 'None', 1, 'Null', 2, 'Row Share', 3, 'Row Excl.', 4,
'Share', 5, 'S/Row Excl.', 6, 'Exclusive', LTRIM(TO_CHAR(Lmode,'990')))
"Lock Mode",
DECODE(l.Request, 0, 'None', 1, 'Null', 2, 'Row Share', 3, 'Row Excl.', 4,
'Share', 5, 'S/Row Excl.', 6, 'Exclusive', LTRIM(TO_CHAR(l.Request, '990')))
"Request",
l.Id1, l.Id2,
d.owner||'.'||d.object_name||'.'||d.subobject_name "Object",
d.object_type "Object Type"
from v$session s, v$lock l, dba_objects d
where (s.sid = l.sid) and l.Id1=d.object_id;
A better way to check the locks:
SQL> select name, mode_held from dba_dml_locks;
NAME MODE_HELD
------------------------------ -------------
TEST_CLOB_SHRINK Row-X (SX)
TEST_CLOB_SHRINK Exclusive
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/17168579/viewspace-1047324/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/17168579/viewspace-1047324/