oracle ora-60 deadlock發生在多個會話的情況
ora-60錯誤可以發生在兩個會話之間,即兩個會話之間互相持有一個對方等待的資源(A deadlock occurs when a session (A) wants a resource held by another session (B) , but that session also wants a resource held by the first session (A). )。如果幾個會話之間的資源爭用是環形,這也是死鎖,並且oracle同樣會監測到並處理。
以下演示:
DB Version:11.2.0.4
建測試表:
create table scott.tb_60
(
num NUMBER,
txt VARCHAR2(10)
);
insert into scott.tb_60 values ( 1, 'First' );
insert into scott.tb_60 values ( 2, 'Second' );
insert into scott.tb_60 values ( 3, 'Third' );
commit;
會話1:
更新num=1的記錄
update scott.tb_60
set txt='a'
where num=1;
會話2:
更新num=2的記錄
update scott.tb_60
set txt='b'
where num=2;
更新num=1的記錄,此時會話2等待會話1提交或回滾來釋放num=1上的tx鎖
update scott.tb_60
set txt='a'
where num=1;
會話3:
更新num=3的記錄
update scott.tb_60
set txt='c'
where num=3;
更新num=2的記錄,此時會話3等待會話2提交或回滾來釋放num=2上的tx鎖
update scott.tb_60
set txt='b'
where num=2;
會話1:
更新num=3的記錄,此時會話1等待會話3提交或回滾來釋放num=3上的tx鎖,死鎖產生
update scott.tb_60
set txt='c'
where num=3;
報錯資訊:
ORA-00060: deadlock detected while waiting for resource
資料庫alert.log中記錄錯誤
ORA-00060: Deadlock detected. More info in file /u01/app/oracle/diag/rdbms/ct6601z3/ct6601z3/trace/ct6601z3_ora_6528.trc.
對應的trace file中記錄死鎖的相關資訊
Deadlock graph:
---------Blocker(s)-------- ---------Waiter(s)---------
Resource Name process session holds waits process session holds waits
TX-000a0005-00000c72 27 197 X 28 8 X
TX-0001001a-00000ca7 28 8 X 26 132 X
TX-00030001-00000d4e 26 132 X 27 197 X
session 197: DID 0001-001B-00000004 session 8: DID 0001-001C-00000002
session 8: DID 0001-001C-00000002 session 132: DID 0001-001A-00000004
session 132: DID 0001-001A-00000004 session 197: DID 0001-001B-00000004
Rows waited on:
Session 197: obj - rowid = 00038F6D - AAA49tAAEAAABlkAAA
(dictionary objn - 233325, file - 4, block - 6500, slot - 0)
Session 8: obj - rowid = 00038F6D - AAA49tAAEAAABlkAAB
(dictionary objn - 233325, file - 4, block - 6500, slot - 1)
Session 132: obj - rowid = 00038F6D - AAA49tAAEAAABlkAAC
(dictionary objn - 233325, file - 4, block - 6500, slot - 2)
...
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28539951/viewspace-2139925/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle優化案例-Bug 32852504 - ORA-60 deadlock detected(三十六)Oracle優化
- 多個Filter的執行具體情況Filter
- 使用ass109.awk 分析會話阻塞情況會話
- mysql left join的時候又表是多條記錄的話,會出現冗餘的情況MySql
- 同一會話中的多個 WebRequest會話Web
- 如何實現多個版本的jQuery庫共存的情況jQuery
- mysql索引不會命中的情況MySql索引
- Oracle其它情況的恢復Oracle
- eMarketer:印尼社會化網路發展情況
- Mysql 會導致索引失效的情況MySql索引
- oracle order by索引是否使用的情況Oracle索引
- ORACLE索引被抑制情況Oracle索引
- 一句話計算出 TopN 的增長情況
- CIO:採用多雲策略的情況分析
- 多種情況解析深複製
- Oracle資料庫經常會遇到CPU利用率很高的情況Oracle資料庫
- screen 命令示例:管理多個終端會話會話
- Oracle 查詢DB的負載情況Oracle負載
- Oracle 時段負載情況Oracle負載
- 檢查oracle的patch的升級情況Oracle
- 下一個成為IE會不會是Chrome,看看是什麼情況。Chrome
- oracle實用sql(7)--單個會話或會話間statistics對比OracleSQL會話
- ORACLE expdp在表空間較多的情況下執行非常緩慢Oracle
- oracle的會話如何自殺?Oracle會話
- 在bean為singleton的情況下,為什麼同一個applicationContext會獲取多個不同的bean例項??BeanAPPContext
- Linux中什麼情況下會發生程式排程?Linux
- Oracle 會話(Session)Oracle會話Session
- oracle鎖會話Oracle會話
- ORACLE SQL的查詢表的鎖的情況OracleSQL
- 請教banq:在實踐機會不多的情況下如何提升java功力,多謝Java
- 監控oracle的連線(session)情況[Z]OracleSession
- [zt] Oracle不使用索引的幾種情況Oracle索引
- Jumptap:美國手機遊戲的流量高峰多發生在下午和晚上遊戲
- oracle 11g rac asmcmd du 命令不顯示的一個情況OracleASM
- 記maven專案的兩個奇怪情況Maven
- <img>標籤的src=""空字元會出現的情況字元
- oracle中會話的狀態Oracle會話
- ?ORACLE會話超時Oracle會話