ORA-00054, 资源忙。 应该是表对象的锁没有释放。
有关Oracle 锁的说明,参考:ORACLE锁机制 http://blog.csdn.net/tianlesoftware/article/details/4696896
用如下SQL 查看一下系统中相关对象上锁的情况:SELECT distinct S.SID SESSION_ID,
S.STATUS,
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,
S2.SQL_TEXT
FROM V$LOCK L,
SYS.DBA_OBJECTS O,
V$SESSION S,
V$ACCESS A,
V$SQL S2
WHERE L.SID = S.SID
AND L.ID1 = O.OBJECT_ID
AND S.SID = A.SID
AND S2.HASH_VALUE = S.SQL_HASH_VALUE
S.STATUS,
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,
S2.SQL_TEXT
FROM V$LOCK L,
SYS.DBA_OBJECTS O,
V$SESSION S,
V$ACCESS A,
V$SQL S2
WHERE L.SID = S.SID
AND L.ID1 = O.OBJECT_ID
AND S.SID = A.SID
AND S2.HASH_VALUE = S.SQL_HASH_VALUE
AND A.OBJECT = 'PROC_VALIDATE_RULE_V3';
该SQL 显示所有对象上的锁,如果要查某个具体的对象,可以根据OBJECT_NAME 字段进行一下过滤,找到对应的SID 之后去查V$SESSION 视图。
该视图会显示session 对应的信息,包括终端的信息,如果找到了终端,可以让它提交或者回滚一下就OK了。 我这里是测试环境,直接把session kill 掉了。然后修改表就ok了。
[sql] view plaincopy
- SQL>alter system kill session 'SID,SERIAL#'
效果如下: