有时候在drop表或者其他对象的时候,会遇到ORA-00054:资源正忙,要求指定NOWAIT(中文字符集)或者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 Cause: Interest
--ORA-00054:资源正忙,要求指定NOWAIT-- --以DBA角色, 查看当前数据库里锁的情况可以用如下SQL语句-- SELECT sid, serial#, username, osuser FROM v$session WHERE sid IN(SELECT session_id FROM v$locked_object); --杀掉锁-- ALTER SYSTEM KILL SESSION 'sid,serial#'; ALTER SYSTEM KILL SESSION '15
现象: 执行update.truncate提示 ORA-00054: resource busy and acquire with NOWAIT specified. 解决方法: 因为系统是RAC系统,当时在第一个node没有查询到锁状态,查看第二台时候才看到锁的信息 1.查询数据库中的锁 select * from v$lock; select * from v$lock where block=1; 2.查询被锁的对象 select * from v$locked_object; 3.查询阻
1.查询被锁的会话ID: select session_id from v$locked_object;查询结果:SESSION_ID-------92.查询上面会话的详细信息: SELECT sid, serial#, username, osuser FROM v$session where sid = 9; 3.将上面锁定的会话关闭: ALTER SYSTEM KILL SESSION '9,99';
打开sql plus select session_id from v$locked_object;查询出oracle锁定的会话ID SELECT sid, serial#, username, osuser FROM v$session where sid = 1; 查询出当前会话数的信息 ALTER SYSTEM KILL SESSION '200,2141'; 杀掉当前会话 注:'200,2141'是:SID和SERIAL字段进行拼接的
查询所有会话 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; 强行结束会话 alter system kill session 'sid,serial';
select l.session_id,o.owner,o.object_name from v$locked_object l,dba_objects o where l.object_id=o.object_id; select t2.username,t2.sid,t2.serial#,t2.logon_time from v$locked_object t1,v$session t2 ,,,,,,,) order by t2.logon_time;
Oracle解锁,解决“ora00054:资源正忙”错误 一.处理步骤:--1.获取被锁对象的session_idSELECT session_id FROM v$locked_object; --2.通过session_id获取v$session的sid和serial#SELECT sid, serial#, username, osuser FROM v$session where sid = session_id; --3.终止相关进程.ALTER SYSTEM KILL SESSION