Oracle解锁,解决“ORA-00054:资源正忙”错误
Oracle解锁,解决“ORA-00054:资源正忙”错误
一.处理步骤:
--1.获取被锁对象的session_id
SELECT 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 'sid,serial';
二.示例:
SQL> select session_id from v$locked_object;
SESSION_ID
----------
141
SQL> SELECT sid, serial#, username, osuser FROM v$session where sid = 141;
SID SERIAL# USERNAME OSUSER
---------- ---------- ------------------------------ ------------------------------
141 41464 VC VC02\Admin
SQL> ALTER SYSTEM KILL SESSION '141,41464';
System altered
SQL> select session_id from v$locked_object;
SESSION_ID
----------