【错误整理】ora-00054:resource busy and acquire with nowait specified解决方法【转】
当某个数据库用户在数据库中插入、更新、删除一个表的数据,或者增加一个表的主键时或者表的索引时,常常会出现ora-00054:resource busy and acquire with nowait specified这样的错误。
主要是因为有事务正在执行(或者事务已经被锁),所有导致执行不成功。
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;
如:testuser 339 13545 2009-3-5 17:40:05
知道被锁的用户testuser,sid为339,serial#为13545
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;
查出来的sql,如: begin :id := sys.dbms_transaction.local_transaction_id; end;
3、kill该事务
alter system kill session '339,13545';
4、这样就可以执行其他的事务sql语句了
如增加表的主键:
alter table test
add constraint PK_test primary key (test_NO);
若提示:ORA-00030: User session ID does not exist
alter session set events 'immediate trace name flush_cache level 1';
后果不详
ORA-00031: session marked for kill
一些ORACLE中的进程被杀掉后,状态被置为"killed",但是锁定的资源很长时间不释放,有时实在没办法,只好重启数据库。现在提供一种方法解决这种问题,那就是在ORACLE中杀不掉的,在OS一级再杀。
1.下面的语句用来查询哪些对象被锁:
select object_name,machine,s.sid,s.serial#
from v$locked_object l,dba_objects o ,v$session s
where l.object_id = o.object_id and l.session_id=s.sid;
2.下面的语句用来杀死一个进程:
alter system kill session '24,111'; (其中24,111分别是上面查询出的sid,serial#)
【注】以上两步,可以通过Oracle的管理控制台来执行。
3.如果利用上面的命令杀死一个进程后,进程状态被置为"killed",但是锁定的资源很长时间没有被释放,那么可以在os一级再杀死相应的进程(线程),首先执行下面的语句获得进程(线程)号:
select spid, osuser, s.program
from v$session s,v$process p
where s.paddr=p.addr and s.sid=24 (24是上面的sid)
4.在OS上杀死这个进程(线程):
1)在unix上,用root身份执行命令:
#kill -9 12345(即第3步查询出的spid)
2)在windows(unix也适用)用orakill杀死线程,orakill是oracle提供的一个可执行命令,语法为:
orakill sid thread
其中:
sid:表示要杀死的进程属于的实例名
thread:是要杀掉的线程号,即第3步查询出的spid。
例:c:>orakill orcl 12345
ORA-00031: session marked for kill
Cause: The session specified in an ALTER SYSTEM KILL SESSION command cannot be killed immediately (because it is rolling back or blocked on a network operation), but it has been marked for kill. This means it will be killed as soon as possible after its current uninterruptible operation is done.
Action: No action is required for the session to be killed, but further executions of the ALTER SYSTEM KILL SESSION command on this session may cause the session to be killed sooner.
kill -9 12345
【错误整理】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 ...
- ORA-00054:resource busy and acquire with nowait specified解决方法
1.用dba权限的用户查看数据库都有哪些锁 SELECT T2.USERNAME,T2.SID,T2.SERIAL#,T2.LOGON_TIME FROM V$LOCKED_OBJECT ...
- ORA-00054: resource busy and acquire with NOWAIT specified
删除表时遇到 ORA-00054:资源正忙,要求指定NOWAIT 错误.以前在灾备中心遇到过. 资源被锁定了,没有办法删除. 报错日志:ORA-00054: resource busy and acq ...
- 解决oracle数据库 ora-00054:resource busy and acquire with NOWAIT specified 错误
解决oracle数据库 ora-00054:resource busy and acquire with NOWAIT specified 错误 本人在使用pl/sql developer 客户端调用 ...
- ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
开发说测试环境在删除表的时候,报了如下错误: SQL> drop table tke purge; drop table tke purge * ERROR at line 1: ORA-000 ...
- 【Oracle】ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired
出现此错误的原因是因为事务等待造成的,找出等待的事务,kill即可. 下面是我当时遇到的错误: ---删除表t1时出现错误 SCOTT@GOOD> drop table t1; drop tab ...
- oracle之 RA-00054: resource busy and acquire with NOWAIT specified or timeout expired
1. truncate 表报 ORA-00054 ,标明有事务正在操作该表SQL> truncate table alldm.DM_XQKD_YUJING_D;truncate table al ...
- Error: EBUSY: resource busy or locked, symlink "xxx" 的解决方法
上面是报错信息. 解决方法:当我们在npm i 安装依赖的时候,会遇到这个Error: EBUSY: resource busy or locked, symlink....的问题.解决的 办法就是关 ...
- Oracle数据库操作总是显示运行中无法成功,删除表时报错 resource busy and acquire with NOWAIT specified
1.直接运行以下语句: select t2.username,t2.sid,t2.serial#,t2.logon_timefrom v$locked_object t1,v$session t2wh ...
随机推荐
- C# 中 List.Sort运用(IComparer<T>)排序用法
/// <summary> /// 比较人物类实例大小,实现接口IComparer /// </summary> public class InternetProtocolCo ...
- EF5+MVC4系列(1) Podwerdesigner15.1设计数据库;PD中间表和EF实体模型设计器生成中间表的区别;EF5.0 表关系插入数据(一对多,多对多)
在上一篇文章中, http://www.cnblogs.com/joeylee/p/3790980.html 我们用 PD15.1 来设计了数据库,并且生成 了sql数据库,现在我们用 vs2013 ...
- redis集群【转】
一.环境 系统 CentOS7.0 64位最小化安装 redis1 172.16.1.46 6379,6380 redis2 172.16.1.47 6379,6380 ...
- python2除法保留小数部分
转载:http://www.cnblogs.com/yhleng/p/9223944.html 1.python2和python3除法的最大区别: python2: print 500/1000 py ...
- 转 linux 权限
发布系统架构图简化如下: 管理员通过Jenkins调用“发布程序(代号varian,以下简称varian)”,发布程序会进行一系列的初始化操作,完成后生成Docker镜像上传到Docker仓库,容器集 ...
- fitnesse页面增加认证
一.增加用户认证1. 只增加一个认证用户:java -jar fitnesse.jar -a username:password 2. 增加多个认证用户(明文密码) 2.1 新建一个passwo ...
- Nginx系列6之-rewirte功能使用案例总结
使用案例1 网站架构如下: 公司部分服务器目前通过二级目录来调度到不同的服务器,如下所示: 按照上述需求,我们此时就配置了两个location,如下所示: [root@localhost nginx] ...
- (IRCNN)Learning Deep CNN Denoiser Prior for Image Restoration-Kai Zhang
学习深度CNN去噪先验用于图像恢复(Learning Deep CNN Denoiser Prior for Image Restoration)-Kai Zhang 代码:https://githu ...
- 使用System.Web.Optimization对CSS和JS文件合并压缩
在ASP.NET MVC 中JS/CSS文件动态合并及压缩通过调用System.Web.Optimization定义的类ScriptBundle及StyleBundle来实现. 大致步骤如下: 1.A ...
- JavaWeb跨域访问问题
转载: http://blog.csdn.net/zjq_1314520/article/details/65449279 最后的解决方案如下: 在 tomcat 的 conf目录下找到 web.xm ...