PLSQL記錄被另外一個用戶鎖住

一、查看數據庫鎖,診斷鎖的來源及類型:數據庫

select object_id,session_id,locked_mode from v$locked_object;session

或者用如下命令:get

select b.owner,b.object_name,l.session_id,l.locked_mode from v$locked_object l, dba_objects b where b.object_id=l.object_idio

二、找出數據庫的serial#,以備殺死:object

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;select

三、殺死該session:   im

alter system kill session 'sid,serial#'數據

(說明:sid,serial要和上面1,2查出結果對應)db

相關文章
相關標籤/搜索