oracle之报错:ORA-00054: 资源正忙,要求指定 NOWAIT
原因:资源被锁定,需要释放
解决方案:
select session_id from v$locked_object; --首先得到被锁对象的session_id
SELECT sid, serial#, username, osuser FROM v$session where sid = session_id; --通过上面得到的session_id去取得v$session的sid和serial#,然后对该进程进行终止。
ALTER SYSTEM KILL SESSION 'sid,serial';
example:
ALTER SYSTEM KILL SESSION '13, 8';
详细解释可参考:
https://www.cnblogs.com/ys-wuhan/p/5956983.html
--解锁
select session_id from v$locked_object
SELECT sid, serial#, username, osuser FROM v$session where sid = '20';
ALTER SYSTEM KILL SESSION '20,1862';