问题描述:
我在oem下执行一些操作时,有时碰到如下信息:
如何解决ORA-00054资源正忙,要求指定NOWAIT,
查阅错误代码指南后有如下提示:
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.
解决方法:
1.通过上句查找出已被锁定的数据库表及相关的sid、serial#及spid
select object_name as 对象名称,s.sid,s.serial#,p.spid as 系统进程号
from v$locked_object l , dba_objects o , v$session s , v$process p
where l.object_id=o.object_id and l.session_id=s.sid and s.paddr=p.addr;
2.在数据库中灭掉相关session
alter system kill session 'sid,serial#';--sid及serial#为第一步查出来的数据
举例:
select object_name as 对象名称,s.sid,s.serial#,p.spid as 系统进程号
from v$locked_object l , dba_objects o , v$session s , v$process p
where l.object_id=o.object_id and l.session_id=s.sid and s.paddr=p.addr;
alter system kill session '125,287'