1,查看被锁对象及锁类型、锁模式
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.OWNER|| ' . ' || O.OBJECT_NAME|| ' ( ' || O.OBJECT_TYPE|| ' ) ' as OBJECT_NAME,
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;
2,使用sid信息查看视图V$SESSION,获取sid,serial#信息
select * from v$session where sid=?
3,通知会话用户发布rollback或commit命令结束事务,或强制结束会话
alter system kill session "sid,serial#";
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.OWNER|| ' . ' || O.OBJECT_NAME|| ' ( ' || O.OBJECT_TYPE|| ' ) ' as OBJECT_NAME,
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;
2,使用sid信息查看视图V$SESSION,获取sid,serial#信息
select * from v$session where sid=?
3,通知会话用户发布rollback或commit命令结束事务,或强制结束会话
alter system kill session "sid,serial#";
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/14359/viewspace-718112/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/14359/viewspace-718112/