首页 > 数据库技术 > 详细

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

时间:2015-03-30 09:33:40      阅读:959      评论:0      收藏:0      [点我收藏+]

向某个数据库用户中插入、更新、删除一个表的数据,或是增加一个表的主键、索引时,出现下面的错误:

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

这是因为有事务正在进行或是事务已经被锁,因此导致不成功

 

1)用dba权限的用户查询数据库中有哪些锁

select t2.username,t2.sid,t2.serial#,t2.logon_time from v$locked_object t1,v$session t2 where t1.session_id=t2.sid order by t2.logon_time;

技术分享

根据查询结果,可以看到用户ad,sid为5185,serial#为11357


2)根据sid查询具体的sql语句,如果sql不重要,可以直接kill掉

select sql_text from v$session a,v$sqltext_with_newlines b where DECODE(a.sql_hash_value, 0, prev_hash_value, sql_hash_value)=b.hash_value and a.sid=&sid order by piece;


3)kill该事务

alter system kill session '5185,11357;

4)接着执行自己需要执行的操作

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

原文:http://blog.csdn.net/henujyj/article/details/44729557

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!