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 contentionENQIndex
- enq: TX - index contentionENQIndex
- enq: TX - index contention等待ENQIndex
- enq: TX - index contention基礎理論ENQIndex
- Troubleshooting 'enq: TX - index contention' WaitsENQIndexAI
- 如何解決enq: TX- index contentionENQIndex
- 'enq: TX - index contention' Waits in a RAC Environment. [ID 873243.1]ENQIndexAI
- enq: TX - row lock contentionENQ
- 【MOS】Troubleshooting 'enq: TX - index contention' Waits (文件 ID 873243.1)ENQIndexAI
- zt_Oracle enq: TX contention 和 enq: TM contention 等待事件OracleENQ事件
- 關於enq: TX - index contention 等待的探討與測試ENQIndex
- 等待事件enq: TX - row lock contention事件ENQ
- 【等待事件】-enq: TX - row lock contention事件ENQ
- 奇異的enq: TX - row lock contentionENQ
- 等待事件enq TX row lock contention分析事件ENQ
- enq: TX - row lock contention等待事件處理ENQ事件
- 【故障解決】enq: PS - contentionENQ
- AWR實戰分析之----enq: TX - row lock contentionENQ
- Oracle Enqueues Wait Events 三 enq: TX - row lock contentionOracleENQAI
- enq: TX – row lock contention的測試和案例分析ENQ
- 無關的表引起的enq: TX - row lock contentionENQ
- 關於enq: TX - row lock contention行鎖的總結ENQ
- 20161208理解enq TX - row lock contentionENQ
- ORACLE 歸檔空間滿導致的enq: TX - row lock contentionOracleENQ
- 使用oradebug dump processstate 來診斷enq: TX - row lock contentionENQ
- 故障處理】佇列等待之enq: US - contention案例佇列ENQ
- 【故障處理】佇列等待之enq: US - contention案例佇列ENQ
- 【故障處理】佇列等待之enq IV - contention案例佇列ENQ
- 【kingsql分享】RAC節點故障修復一例SQL
- enq: US - contentionENQ
- enq: HW - contentionENQ
- enq: TM - contentionENQ
- enq:TM contentionENQ
- enq: DX - contentionENQ
- enq: TS - contentionENQ
- 一次資料庫相關操作卡住的排查--enq: TX - row lock contention資料庫ENQ
- enq: TX - allocate ITL entryENQ