Oracle死鎖
手動修改某表的記錄,彈出以下錯誤:
然後嘗試用PL/SQL語句修改記錄,十多分鐘過去了,一直顯示正在執行;
結論:死鎖了!!
查看被鎖對象:
SELECT l.session_id sid,
s.serial#,
l.locked_mode 鎖模式,
l.oracle_username 登錄用戶,
l.os_user_name 登錄機器用戶名,
s.machine 機器名,
s.terminal 終端用戶名,
o.object_name 被鎖對象名,
s.logon_time 登錄數據庫時間
FROM v$locked_object l, all_objects o, v$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid
ORDER BY sid, s.serial#;
<喎?http://www.Bkjia.com/kf/ware/vc/" target="_blank" class="keylink">vc3Ryb25nPgo8c3Ryb25nPsmxtfS4w8v4ttTP86O6PC9zdHJvbmc+CsSjsOWjumFsdGVyIHN5c3RlbSBraWxsIHNlc3Npb24g"sid,serial#' immediate;
實例:alter system kill session '7,223' immediate;