Oracle中的ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

來源:互聯網
上載者:User

標籤:oracle錯誤

向某個資料庫使用者中插入、更新、刪除一個表的資料,或是增加一個表的主鍵、索引時,出現下面的錯誤:

ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

這是因為有事務進行中或是事務已經被鎖,因此導致不成功

 

1)用dba許可權的使用者查詢資料庫中有哪些鎖

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;


根據查詢結果,可以看到使用者ad,sid為5185,serial#為11357


2)根據sid查詢具體的sql語句,如果sql不重要,可以直接kill掉

select sql_text from v$session a,v$sqltext_with_newlines b where DECODE(a.sql_hash_value, 0, prev_hash_value, sql_hash_value)=b.hash_value and a.sid=&sid order by piece;


3)kill該事務

alter system kill session '5185,11357;

4)接著執行自己需要執行的操作

Oracle中的ORA-00054: resource busy and acquire with NOWAIT specified or timeout expired

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.