|
|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。如果您注册时有任何问题请联系客服QQ: 83569622 。
您需要 登录 才可以下载或查看,没有帐号?注册
x
ora-00054 and ora-00031
今天在创建索引的时候,抛出了ORA-00054 这个错误,检索了一下 http://ora-00054.ora-code.com/ 得到如下信息:ORA-00054: resource busy and acquire with NOWAIT specified Cause: The NOWAIT keyword forced a return to the command prompt because a resource was unavailable for a LOCK TABLE or SELECT FOR UPDATE command. 看来应该是锁的问题,检查锁信息:select object_name 对象名称,machine as 主机,s.program 程序,s.sid,s.serial#,p.spid as OS进程号 from v$locked_object l,dba_objects o ,v$session s ,v$process pwhere l.object_id=o.object_id and l.session_id=s.sidand s.paddr=p.addr;
执行alter system kill session 'sid,serial#';
抛出ora-00031,检索http://ora-00031.ora-code.com/得到如下信息:
ORA-00031:
session marked for kill
Cause:
The session specified in an ALTER SYSTEM KILL SESSION command cannot be killed immediately because the session is involved in a non-interruptible operation (for example, rolling back a transaction or being blocked by a network operation). The session has been marked to be killed as soon as possible after the current 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.
表示此会话已经标记为被删除但是仍然在作一些rollback的工作资源暂时不会被释放
执行:
select object_name 对象名称,machine as 主机,s.program 程序,s.sid,s.serial#,p.spid as OS进程号 from v$locked_object l,dba_objects o ,v$session s ,v$process pwhere l.object_id=o.object_id and l.session_id=s.sidand s.paddr=p.addr;
得到SID,然后执行
select spid from v$process p,v$session vwhere p.addr=v.paddrand v.sid=?
最后用OS来KILL
cmd下 orakill db_name SPID |
|