Oracle查看锁表及解锁办法

-- 查看被锁表信息
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#;

-- 杀掉锁表进程,KILL SESSION 两个值要换掉 分别为SID和SERIAL#号
ALTER SYSTEM KILL SESSION '702, 23419';
posted @ 2023-05-26 08:41  爱Ni说不出口  阅读(343)  评论(0编辑  收藏  举报