oracle 锁sql排查
racle 出现未释放锁 查询出 sid 与 serial 杀死进程事务 1185
1 2 3 |
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 |
根据 sid 查询出sql sql 不重要 这步可跳过
1 2 3 |
SELECT SQL_TEXT FROM V$SESSION A,V$SQLTEXT_WITH_NEWLINES B WHERE DECODE(A.SQL_HASH_VALUE, 0, PREV_HASH_VALUE, SQL_HASH_VALUE)=B.HASH_VALUE AND A.SID=584 ORDER BY PIECE; |
根据 sid 与 serial kill掉锁定事务 执行后 再次尝试即可
1 |
ALTER SYSTEM KILL SESSION '1161,13720'; |
分类: oracle