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

今天在执行一个drop 表的操作时,报ORA-00054:resource busy and acquire with NOWAIT specified or timeout expired错误信息,

SQL> drop table user_test;
drop table user_test
               *
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
[oracle@test ~]$ oerr ora 54
00054, 00000, "resource busy and acquire with NOWAIT specified or timeout expired"
// *Cause:  Interested resource is busy.
// *Action: Retry if necessary or increase timeout.

按照字面的意思是资源忙被占用了,所以第一时间想到看是哪个会话占用了资源,在做什么操作,数据库此时是不是有锁存在等。

SQL> select l.session_id,o.owner,o.object_name from v$locked_object l,dba_objects o where l.object_id=o.object_id;

SESSION_ID OWNER         OBJECT_NAME
---------- ------------  ------------------------
1655         test           user_test

发现表user_test上有锁存在,根据session_id查找会话的详细信息:

SQL> SELECT sid, serial#, username, oSUSEr, terminal,program ,action, prev_exec_start FROM v$session where sid = 1655;

通过查询v$session可以查到占用资源的会话详细信息,通过如下命令了可以杀掉占用资源的会话;之后再执行drop操作就没问题了。

SQL> alter system kill session '1655,43249';

System altered.

SQL> drop table user_test;

Table dropped.

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

#慧#

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值