您好,登錄后才能下訂單哦!
小編給大家分享一下ORACLE報ORA-02049錯誤怎么辦,希望大家閱讀完這篇文章之后都有所收獲,下面讓我們一起去探討吧!
1.查詢哪個用戶致使死鎖的產生:
select username,lockwait,status,machine,program from v$session where sid in
(select session_id from v$locked_object);
2.查看當前系統鎖情況
SELECT /*+ rule */
lpad(' ', decode(l.xidusn, 0, 3, 0)) || l.oracle_username User_name,
o.owner,
o.object_name,
o.object_type,
s.sid,
s.serial#
FROM v$locked_object l, dba_objects o, v$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid
ORDER BY o.object_id, xidusn DESC;
查看被死鎖的語句
select sql_text from v$sql where hash_value in
(select sql_hash_value from v$session where sid in (select session_id from v$locked_object));
3.查找被死鎖的進程
SELECT s.username,l.OBJECT_ID,l.SESSION_ID,s.SERIAL#, l.ORACLE_USERNAME,
l.OS_USER_NAME,l.PROCESS FROM V$LOCKED_OBJECT l,V$SESSION S
WHERE l.SESSION_ID=S.SID;
4.解鎖,將死鎖進程kill掉
alter system kill session ‘sid,serial#’;
看完了這篇文章,相信你對“ORACLE報ORA-02049錯誤怎么辦”有了一定的了解,如果想了解更多相關知識,歡迎關注億速云行業資訊頻道,感謝各位的閱讀!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。