【Oracle】ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

出现此错误的原因是因为事务等待造成的,找出等待的事务,kill即可。

下面是我当时遇到的错误:

 

---删除表t1时出现错误

SCOTT@GOOD> drop table t1;
drop table t1
           *
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

---登录sys用户或者其他具有权限的用户
SCOTT@GOOD> conn / as sysdba
Connected.

---查找sid和serial#
16:20:10 SYS@GOOD> select t2.username, t2.sid, t2.serial#, t2.logon_time
16:43:17   2  from v$locked_object t1, v$session t2
16:43:17   3  where t1.session_id = t2.sid
16:43:17   4  order by t2.logon_time;

USERNAME              SID    SERIAL#   LOGON_TIM
------------------------------ ---------- ---------- ---------
TOM                   147    1395     25-DEC-16

---kill掉即可
16:43:18 SYS@GOOD> alter system kill session '147,1395';

System altered.

---t1表删除成功
SCOTT@GOOD> drop table t1;

Table dropped.


 


 

posted on 2016-12-25 16:45  Diegoal  阅读(443)  评论(0编辑  收藏  举报

导航