oracle 锁表sql查询及解锁
程序员文章站
2022-06-02 13:00:06
...
1.锁表sql查询,可查看导致锁表的sql
SELECT L.SESSION_ID SID,
S.SERIAL#,
L.LOCKED_MODE,
L.ORACLE_USERNAME,
S.USER#,
L.OS_USER_NAME,
S.MACHINE,
S.TERMINAL,
A.SQL_TEXT,
A.ACTION
FROM V$SQLAREA A, V$SESSION S, V$LOCKED_OBJECT L
WHERE L.SESSION_ID = S.SID
AND S.PREV_SQL_ADDR = A.ADDRESS
ORDER BY SID, S.SERIAL#;
2.杀死锁表进程
alter system kill session 'SID,SERIAL#';