解决oracle数据库 ora-00054:resource busy and acquire with NOWAIT specified 错误
解决oracle数据库 ora-00054:resource busy and acquire with NOWAIT specified 错误
本人在使用pl/sql developer 客户端调用存储过程进行操作时发现中途卡机然后强制终止pl/sql developer 之后,oracle就一直出现锁相关的错误。
经分析认为在调用存储过程时对表进行了DDL语句操作时导致了悲观封锁。客户端卡机后oracle一直没有对这个锁进行释放且一直不会完成释放导致错误。
需要对此会话进行强制杀掉:
1. 查询当前被锁的对象SELECT * FROM V$LOCKED_OBJECT WHERE ORACLE_USERNAME= 'ATHENA';
SQL> SELECT * FROM V$LOCKED_OBJECT WHERE ORACLE_USERNAME= 'ATHENA';
XIDUSN XIDSLOT XIDSQN OBJECT_ID SESSION_ID ORACLE_USERNAME OS_USER_NAME PROCESS LOCKED_MODE
---------- ---------- ---------- ---------- ---------- ------------------------------ ------------------------------ ------------ -----------
19 11 79134 76618 436 ATHENA Administrator 3512:1272 3
11 28 74487 76617 574 ATHENA Administrator 2412:3928 3
20 25 75512 76620 594 ATHENA Administrator 4064:4060 3
2. 查询session信息SQL> SELECT v.sid,v.SERIAL#,v.USERNAME,v.ACTION FROM v$session v WHERE v.sid IN (SELECT session_id FROM v$locked_object WHERE ORACLE_USERNAME= 'ATHENA') AND V.MACHINE='NBCB\KJB-080701N';
SID SERIAL# USERNAME ACTION
---------- ---------- ------------------------------ --------------------------------
436 62365 ATHENA 测试窗口 - procedure PROC_HIS_AR
574 60824 ATHENA 测试窗口 - procedure PROC_HIS_AR
594 &nbs