–1、查看数据库锁,诊断锁的来源及类型:
SELECT OBJECT_ID, SESSION_ID, LOCKED_MODE FROM V$LOCKED_OBJECT;
–2、找出数据库的serial#,以备杀死:
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;
–3、杀死该session
alter system kill session ‘sid,serial#’ ps: sid ,serial# –为步骤2中查出来的值