Oracle中的ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
2015-03-29 19:35
477 查看
向某个数据库用户中插入、更新、删除一个表的数据,或是增加一个表的主键、索引时,出现下面的错误:
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;
![](https://img-blog.csdn.net/20150329193551912?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvaGVudWp5ag==/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center)
根据查询结果,可以看到用户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)接着执行自己需要执行的操作
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
- Oracle 错误:ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
- java.sql.SQLException: ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
- ddl_lock_timeout 与 ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
- oracle之 RA-00054: resource busy and acquire with NOWAIT specified or timeout expired
- ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
- ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
- ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
- ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired解决方法
- oracle之 RA-00054: resource busy and acquire with NOWAIT specified or timeout expired
- ddl_lock_timeout 与 ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
- ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
- oracle ora-00054:resource busy and acquire with nowait specified解决方法
- Oracle之异常ora-00054:resource busy and acquire with nowait specified
- [ORACLE错误]ORA-00054:resource busy and acquire with nowait specified解决方法
- oracle ora-00054:resource busy and acquire with nowait specified解决方法
- 解决锁的问题—-ORA-00054: resource busy and acquire with NOWAIT specified
- ora-00054:resource busy and acquire with nowait specified解决方法
- ora-00054:resource busy and acquire with nowait specified解决方法
- ORA-00054: resource busy and acquire with NOWAIT specified