"ORA-00054 resource busy and acquire with NOWAIT specified"的解決方法
今天在做同步時,出現如下錯誤:
ORA-00054 resource busy and acquire with NOWAIT specified
”資源正忙,需指定nowait"
出現這個問題的原因是正在執行的操作請求的資源正被其他事務鎖定。
nowait:立即執行,如果另有會話正在修改該記錄會立即報告錯誤:ORA-00054: 資源正忙,要求指定 NOWAIT;如果不選擇nowait選項則會一直處理等待狀態。
wait [n]:等待n秒,如果另有會話正在修改該記錄會報告錯誤:ORA-30006: 資源已被佔用; 執行操作時出現 WAIT 超時
=>另外,還有一個skip locked。
skip locked:跳過已被別的會話鎖定的記錄。
例如:
SELECT ... FOR UPDATE [OF ...][NOWAIT | WAIT integer]
NOWAIT指在執行"SELECT ... FOR UPDATE"時其他事務修改了該查尋的結果但還沒有提交,此時將立即返回如下結果:
ORA-00054: resource busy and acquire with NOWAIT specified
如果不使用NOWAIT等項,預設為等待(WAIT)其他事務提交後在返回結果。
WAIT integer,與NOWAIT的功能相似,但可以等待使用者指定的秒數。如:"WAIT 3"等待3秒後,其他事務還沒有提交將返回如下結果:
ORA-30006: resource busy; acquire with WAIT timeout expired 。
出現這種問題後查V$LOCKED_OBJECT,要麼等事務結束後再做,要麼殺掉持有鎖的會話(如果不是關鍵會話):
1.透過上句查詢出已被鎖定的資料庫表及相關的sid、serial#及spid
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
alter system kill session 'sid,serial#';--sid及serial#為第一步查出來的資料。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/670493/viewspace-1025077/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORA-00054: resource busy and acquire with NOWAIT specifiedUIAI
- ORA-00054: resource busy and acquire with NOWAIT specified處理UIAI
- gc buffer busy acquire問題處理GCUI
- no input file specified 三種解決方法
- 解決IDEA Error:Output directory is not specifiedIdeaError
- 解決 Specified key was too long ... 767 bytes 的本質問題
- Access restriction: The type 'Resource' is not API 解決辦法RESTAPI
- 已解決 phpstudy切換nts模式出現的No input file specifiedPHP模式
- 解決nltk_data LookupError: Resource punkt not found.Error
- Laravel Resource Routes和API Resource Routes講解LaravelAPI
- Oracle中的for update 和 for update nowaitOracleAI
- SpringBoot 專案打包後獲取不到resource下資源的解決Spring Boot
- TabError的解決方法Error
- @Resource 與 @Service註解的區別
- @Autowire和@Resource註解的區別
- 在 apache 中重寫規則不生效的問題 [No input file specified.] 解決Apache
- gc buffer busyGC
- 解決程式中Error creating bean with name 'XXXXX‘ defined in class path resource [application的異常ErrorBeanAPP
- spingboot使用@Resource注入靜態變數報空指標的問題解決boot變數指標
- AWR 報告深度解讀:Redo Nowait指標的演算法和診斷AI指標演算法
- apache PHP 隱藏 index.php 報錯 No input file specified. 解決辦法ApachePHPIndex
- 【JavaSE】Lock鎖,獨佔鎖ReentrantLock的AQS原始碼,如何管理同步佇列。acquire方法和release方法JavaReentrantLockAQS原始碼佇列UI
- dns劫持怎麼解決 dns劫持的解決方法DNS
- 完美解決未能正確載入“Visual C++ Resource Editor Package”的錯誤提示C++Package
- 遇到問題的解決方法
- Oracle Buffer Busy WaitsOracleAI
- 解決 PbootCMS 網站轉移後無法開啟報錯提示“No input file specified”的問題boot網站
- buffer busy waits引起的會話突增AI會話
- oracle buffer busy waits等待的含義OracleAI
- undefined reference to錯誤的解決方法Undefined
- Failed to execute aapt的奇怪解決方法AIAPT
- 解決Vue中”This dependency was not found”的方法Vue
- Qt TcpSocket的掉線解決方法QTTCP
- but no encoding declared;問題的解決方法Encoding
- ORACLE ORA-1652的解決方法Oracle
- 金沙不給提款的解決方法
- GoldenGate表異構的解決方法Go
- 跨域的九種解決方法跨域
- pycharm不支援django的解決方法PyCharmDjango