Oracle:ORA-00054

来自WHY42

ORA-00054: 资源正忙, 但指定以 NOWAIT 方式获取资源, 或者超时失效
解决方法如下:

=========================================================
SQL> select session_id from v$locked_object;
SESSION_ID
----------
       56
SQL> SELECT sid, serial#, username, osuser FROM v$session where sid = 142;
       SID    SERIAL# USERNAME                       OSUSER
---------- ---------- ------------------------------ ------------------------------
       56         2088 ghb                          fy
SQL> ALTER SYSTEM KILL SESSION '56,2088';
System altered

执行完上述命令后,提示会话断开。重新连接数据库,然后执行truncate操作,成功!