先查看哪些表被鎖住了
select b
from v$locked_object a
where b
OWNER OBJECT_NAME SESSION_ID LOCKED_MODE
WSSB SBDA_PSHPFTDT
WSSB_RTREPOS WB_RT_SERVICE_QUEUE_TAB
WSSB_RTREPOS WB_RT_NOTIFY_QUEUE_TAB
WSSB_RTREPOS WB_RT_NOTIFY_QUEUE_TAB
WSSB SBDA_PSDBDT
WSSB_RTREPOS WB_RT_AUDIT_DETAIL
select b
from v$locked_object a
where a
USERNAME SID SERIAL# LOGON_TIME
WSSB_RTACCESS
WSSB_RTACCESS
殺會話
alter system kill session
e
alter system kill session
如果有ora
alter system kill session
1
查V$DB_OBJECT_CACHE視圖:
SELECT * FROM V$DB_OBJECT_CACHE WHERE OWNER=
查V$ACCESS視圖:
SELECT * FROM V$ACCESS WHERE OWNER=
查V$SESSION視圖:
SELECT SID
查V$PROCESS視圖:
SELECT SPID FROM V$PROCESS WHERE ADDR=
(
ALTER SYSTEM KILL SESSION
(
KILL
或
ORAKILL 剛才查出的SID 剛才查出的SPID
oracle的死鎖
查詢數據庫死鎖
select t
from v$locked_object t
where t
and t
order by t
查詢出來的結果就是有死鎖的session了
下面就是殺掉
拿到上面查詢出來的SID和SERIAL#
alter system kill session
一般情況可以解決數據庫存在的死鎖了
或通過session id 查到對應的操作系統進程
SELECT a
WHERE c
然後采用kill (unix) 或 orakill(windows )
在unix中
ps
kill
ps
經常在oracle的使用過程中碰到這個問題
sqlplus
SELECT s
FROM V$LOCKED_OBJECT l
alter system kill session
select pro
其中sid用死鎖的sid替換
exit
ps
其中spid是這個進程的進程號
From:http://tw.wingwit.com/Article/program/Oracle/201311/17405.html