enq: TX - index contention故障修復一例
2021年6月1日,一客戶反饋介面資料同步緩慢,有大量積壓。登入資料庫主機檢視負載情況,發現有比較嚴重的阻塞與等待現象。主要等待事件為enq: TX - index contention,gc buffer busy acquire等。
調取AWR報告,發現dbtime相當高。
主要等待事件如下:
更新與插入操作極為緩慢。簡單的insert消耗時間都達到了30秒之多。
可以看到對某個秒的DML操作極為頻繁。檢視AWR報告中的
Segments by Row Lock Waits部分,其中一個索引等待尤其嚴重。
在此次故障中,還存在很嚴重的buffer busy waits
至此可以基本確認是由於這個索引訪問與更新過於頻繁導致。
MOS文件 Troubleshooting 'enq: TX - index contention' Waits (Doc ID 873243.1)如下:
When running an OLTP systems, it is possible to see high TX enqueue contention on index associated with tables, which are having high concurrency from the application. This usually happens when the application performs lot of INSERTs and DELETEs concurrently. For RAC system, the concurrent INSERTs and DELETEs could happen from all the instances .
The reason for this is the index block splits while inserting a new row into the index. The transactions will have to wait for TX lock in mode 4, until the session that is doing the block splits completes the operations.
A session will initiate a index block split, when it can't find space in an index block where it needs to insert a new row. Before starting the split, it would clean out all the keys in the block to check whether there is enough sufficient space in the block.deleted
Splitter has to do the following activities:
o Allocate a new block.
o Copy a percentage of rows to the new buffer.
o Add the new buffer to the index structure and commit the operation.
In RAC environments, this could be an expensive operation, due to the global cache operations included. The impact will be more if the split is happening at a branch or root block level.
Causes:
Most probable reasons are:
o Indexes on the tables which are being accessed heavily from the application.
o Indexes on table columns which are monotonically growing. In other words, most of the index insertions occur only on the right edge of an index.
o Large data purge has been performed, followed by high concurrent insert
最終的解決方案為將索引重建,反向鍵索引
CREATE INDEX <index name> ON <column> REVERSE;
重建之後,問題得到了解決
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/8520577/viewspace-2774912/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 故障排除 | enq:TX - index contention等待事件ENQIndex事件
- enq: TX - index contention基礎理論ENQIndex
- enq: TX - row lock contentionENQ
- 等待事件enq: TX - row lock contention事件ENQ
- 奇異的enq: TX - row lock contentionENQ
- Oracle Enqueues Wait Events 三 enq: TX - row lock contentionOracleENQAI
- 故障處理】佇列等待之enq: US - contention案例佇列ENQ
- 【故障處理】佇列等待之enq: US - contention案例佇列ENQ
- Oracle等待事件之enq: TM – contentionOracle事件ENQ
- oracle等待事件之enq: CF – contentionOracle事件ENQ
- [20220518]enq FU - contention等待事件.txtENQ事件
- GTID環境中手動修復主從故障一例(Error 1146)Error
- enq: TX - allocate ITL entry等待事件分析ENQ事件
- 效能問題,AWR High Event enq: US - contentionENQ
- 關於enq: TX - allocate ITL entry等待事件ENQ事件
- oracle 11.2.0.4 rac叢集等待事件enq: TM - contentionOracle事件ENQ
- ORACLE 如何診斷高水位爭用(enq: HW – contention)OracleENQ
- hive 故障一例Hive
- [20200120]oracle wait event "enq: SQ – contention" and DBA_DB_LINK_SOURCES.txtOracleAIENQ
- [20231026]enq TX - allocate ITL entry的測試4.txtENQ
- Oracle優化案例-系統切換引起的enq: SQ - contention(二十八)Oracle優化ENQ
- enq: TM - contention解決之道——外來鍵無索引導致鎖爭用ENQ索引
- 記一次 Homestead 啟動故障修復
- Tenorshare ReiBoot Pro iOS系統故障修復工具bootiOS
- 【kingsql分享】Oracle18c RAC ADVM卷OFFLINE修復一例SQLOracle
- 故障分析 | MySQL鎖等待超時一例分析MySql
- ibbackup恢復報錯一例
- 電腦安全模式下怎麼修復系統 win10安全模式怎麼修復系統故障模式Win10
- MySQL:5.6 大事務show engine innodb status故障一例MySql
- MySQL:產生大量小relay log的故障一例MySql
- rac二節點例項redo故障無法啟動修復
- SQL故障修復的生命線:Pssdiag和Sqldiag管理器OLSQL
- redis cluster 故障後,主從位於不同節點的修復。Redis
- mysql資料庫恢復一例MySql資料庫
- 硬碟物理故障解決方法之電路板損壞修復方案硬碟
- 雲伺服器論壇搬家實戰操作及故障修復流程伺服器
- 故障分析 | MySQL 耗盡主機記憶體一例分析MySql記憶體
- PrestaShop網站漏洞修復如何修復REST網站