enq: TX - index contention 等待事件

enq: TX - index contention
 
 
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(大批量并发的insert)


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.


Solutions:解决方法
a) Rebuild the index  as reverse key indexes or hash partition the indexes which are listed in the Segments by Row Lock Waits' of the AWR reports            重建索引
b) Consider increasing the CACHE size of the sequences  增大cache值
c) Rebuild or shrink associated index after huge amount of data purge   大批量的数据改动后 索引的收缩或重建
d) Increase PCT_FREE for the index 增大索引块的PCT_FREE
 
gt



来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/30109892/viewspace-1817978/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/30109892/viewspace-1817978/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
处理 "enq: TX - allocate ITL entry" 等待事件的方法如下: 1. 调整事务的设计:如果事务设计不合理,可能导致频繁地请求 ITL 条目,从而引起 "enq: TX - allocate ITL entry" 等待事件。因此,可以通过调整事务的设计来减少对 ITL 条目的需求。 2. 增加 ITL 条目:如果数据库中经常出现 "enq: TX - allocate ITL entry" 等待事件,可能是因为 ITL 条目的数量不足,无法满足并发事务的需求。此时,可以通过增加数据块的大小或者增加 INITRANS 参数的值来增加 ITL 条目的数量。 3. 调整 INITRANS 参数:INITRANS 参数指定了在数据块中分配给 ITL 条目的初始数目。如果 INITRANS 参数的值太小,可能会导致 ITL 条目不足,从而引起 "enq: TX - allocate ITL entry" 等待事件。因此,可以通过增加 INITRANS 参数的值来增加 ITL 条目的数量。 4. 增加数据库缓存:如果数据库缓存不足,可能会导致频繁的磁盘 I/O 操作,从而引起 "enq: TX - allocate ITL entry" 等待事件。因此,可以通过增加数据库缓存的大小来减少磁盘 I/O 操作。 5. 优化 SQL 语句:如果 SQL 语句执行效率低下,可能会导致事务持有锁的时间过长,从而引起 "enq: TX - allocate ITL entry" 等待事件。因此,可以通过优化 SQL 语句来减少事务持有锁的时间。 需要注意的是,如果 "enq: TX - allocate ITL entry" 等待事件出现较为频繁,可能会影响数据库的性能和稳定性,因此应该及时采取措施进行处理。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值