ORA-00054I (oracle資源被鎖定) 的解決方案

來源:互聯網
上載者:User

系統有一個不用的表,想刪除這個表,或者刪除表中的資料,

SQL> drop table testtable;
ERROR at line 1:
ORA-00054: resource busy and acquire with NOWAIT specified

資源正忙,要求制定NOWAIT

 

出現這個問題的原因是正在執行的操作請求的資源正被其他事務鎖定。

 

出現這種問題後查V$LOCKED_OBJECT,要麼等事務結束後再做;

要麼殺掉持有鎖的會話(如果不是關鍵會話):

1.通過上句尋找出已被鎖定的資料庫表及相關的sid、serial#及spid

sqlplus / as sysdba

SQL> select object_name as 對象名稱,s.sid,s.serial#,p.spid as 系統進程號
from v$locked_object l , dba_objects o , v$session s , v$process p
where l.object_id=o.object_id and l.session_id=s.sid and s.paddr=p.addr;

2.在資料庫中滅掉相關session

SQL> alter system kill session 'sid,serial#';--sid及serial#為第一步查出來的資料。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.