ora-00054:resource busy and acquire with nowait specified解決方法
轉自:http://www.cnblogs.com/chuanzifan/archive/2012/05/26/2519695.html
當某個資料庫使用者在資料庫中插入、更新、刪除一個表的資料,或者增加一個表的主鍵時或者表的索引時,常常會出現ora-00054:resource busy and acquire with nowait specified這樣的錯誤。
主要是因為有事務正在執行(或者事務已經被鎖),所有導致執行不成功。
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;
如:testuser 339 13545 2009-3-5 17:40:05
知道被鎖的使用者testuser,sid為339,serial#為13545
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;
查出來的sql,如: begin :id := sys.dbms_transaction.local_transaction_id; end;
3、kill該事務
alter system kill session '339,13545';
4、這樣就可以執行其他的事務sql語句了
如增加表的主鍵:
alter table test
add constraint PK_test primary key (test_NO);
若提示:ORA-00030: User session ID does not exist
alter session set events 'immediate trace name flush_cache level 1';
後果不詳
ORA-00031: session marked for kill
一些ORACLE中的程式被殺掉後,狀態被置為"killed",但是鎖定的資源很長時間不釋放,有時實在沒辦法,只好重啟資料庫。現在提供一種方法解決這種問題,那就是在ORACLE中殺不掉的,在OS一級再殺。
1.下面的語句用來查詢哪些物件被鎖:
select object_name,machine,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;
2.下面的語句用來殺死一個程式:
alter system kill session '24,111'; (其中24,111分別是上面查詢出的sid,serial#)
【注】以上兩步,可以透過Oracle的管理控制檯來執行。
3.如果利用上面的命令殺死一個程式後,程式狀態被置為"killed",但是鎖定的資源很長時間沒有被釋放,那麼可以在os一級再殺死相應的程式(執行緒),首先執行下面的語句獲得程式(執行緒)號:
select spid, osuser, s.program
from v$session s,v$process p
where s.paddr=p.addr and s.sid=24 (24是上面的sid)
4.在OS上殺死這個程式(執行緒):
1)在unix上,用root身份執行命令:
#kill -9 12345(即第3步查詢出的spid)
2)在windows(unix也適用)用orakill殺死執行緒,orakill是oracle提供的一個可執行命令,語法為:
orakill sid thread
其中:
sid:表示要殺死的程式屬於的例項名
thread:是要殺掉的執行緒號,即第3步查詢出的spid。
例:c:>orakill orcl 12345
ORA-00031: session marked for kill
Cause: The session specified in an ALTER SYSTEM KILL SESSION command cannot be killed immediately (because it is rolling back or blocked on a network operation), but it has been marked for kill. This means it will be killed as soon as possible after its current uninterruptible operation is done.
Action: No action is required for the session to be killed, but further executions of the ALTER SYSTEM KILL SESSION command on this session may cause the session to be killed sooner.
kill -9 12345
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/14663377/viewspace-1060777/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- "ORA-00054 resource busy and acquire with NOWAIT specified"的解決方法UIAI
- ORA-00054: resource busy and acquire with NOWAIT specifiedUIAI
- ora-00054:resource busy and acquire with nowait specifiedUIAI
- ORA-00054: resource busy and acquire with NOWAIT specified處理UIAI
- ORA-00054:resource busy and acquire with nowaitUIAI
- ORA-00054: resource busy and acquire with NOWAITUIAI
- oracle之 RA-00054: resource busy and acquire with NOWAITOracleUIAI
- ORA-00054,ORA-00031 resource busy and acquire with NOWAIT 資源佔用處理過程UIAI
- Oracle wait interface - ORA-00054: resource busyOracleAI
- No input file specified 解決方法
- 如何解決ORA-00054資源正忙,要求指定NOWAITAI
- 【Oracle】ORA-00054 錯誤解決方法Oracle
- ORA-00054 解決方法其中 1 例.
- gc buffer busy acquire問題處理GCUI
- 分析解決11gR2 雙節點RAC環境下的gc cr block busy/gc buffer busy acquire等待GCBloCUI
- no input file specified 三種解決方法
- open failed: EBUSY (Device or resource busy)AIdev
- ORA-00054: 資源正忙,要求指定 NOWAITAI
- ORA-25507: resource 解決方法
- Oracle ASM oracleasm createdisk "Device or resource busy"OracleASMdev
- RAC遇到GC Buffer Busy的解決方法2GC
- RAC遇到GC Buffer Busy的解決方法1GC
- No input file specified 出現的原因及解決方法
- ora-00054: 資源正忙, 但指定以 nowait 方式獲取資源如何解決AI
- mysql 1449 : The user specified as a definer ('root'@'%') does not exist 解決方法MySql
- 啟動Amoeba報The stack size specified is too small解決方法
- oracle之報錯:ORA-00054: 資源正忙,要求指定 NOWAITOracleAI
- ORA-00054錯誤解決方案(摘)
- device-mapper create ioctl failed: Device or resource busydevAPPAI
- 【轉】RAC安裝時,報The specified nodes are not clusterable 的解決方法
- FILE ON OCFS CANNOT BE DELETED LINUX ERROR: 16: DEVICE OR RESOURCE BUSYdeleteLinuxErrordev
- oracle錯誤處理之ORA-00054:資源正忙,要求指定NOWAITOracleAI
- 解決IDEA Error:Output directory is not specifiedIdeaError
- C# Aes CryptoStream Specified padding mode is not valid for this algorithm的解決方法C#paddingGo
- Linux rm -rf 之rm: cannot remove `linux': Device or resource busyLinuxREMdev
- 解決umount.nfs: /data: device is busy 問題NFSdev
- 解決 CRS-2640: Required resourceUI
- Access restriction: The type 'Resource' is not API 解決辦法RESTAPI