Troubleshooting waits for 'enq: TX - allocate ITL entry' (Doc ID 1472175.1)

Troubleshooting waits for 'enq: TX - allocate ITL entry' (Doc ID 1472175.1) header
In this Document
Symptoms
Cause
Solution
Increase INITRANS
Increase PCTFREE
A Combination of increasing both INITRANS and PCTFREE

References

APPLIES TO:
Oracle Database - Enterprise Edition - Version 10.2.0.1 and later
Oracle Database Cloud Schema Service - Version N/A and later
Oracle Database Exadata Express Cloud Service - Version N/A and later
Gen 1 Exadata Cloud at Customer (Oracle Exadata Database Cloud Machine) - Version N/A and later
Oracle Cloud Infrastructure - Database Service - Version N/A and later
Information in this document applies to any platform.
SYMPTOMS
Observe high waits for event enq: TX - allocate ITL entry
Top 5 Timed Foreground Events
Event Waits Time(s) Avg wait (ms) % DB time Wait Class
enq: TX - allocate ITL entry 1,200 3,129 2607 85.22 Configuration
DB CPU 323 8.79
gc buffer busy acquire 17,261 50 3 1.37 Cluster
gc cr block 2-way 143,108 48 0 1.32 Cluster
gc current block busy 10,631 46 4 1.24 Cluster

CAUSE
By default the INITRANS value for a table is one, and for an index is two. This defines an internal block structure called the Interested Transaction List (ITL). In order to modify data in a block, a process needs to use an empty ITL slot to record that the transaction is interested in modifying some of the data in the block. If there are insufficient free ITL slots then new ones will be taken in the free space reserved in the block. If this runs out and too many concurrent DML transactions are competing for the same data block we observe contention against the following wait event - "enq: TX - allocate ITL entry".

You can see candidates for re-organisation due to ITL problems in the "Segments by ITL Waits" section of an Automatic Workload Repository (AWR) report:

Segments by ITL Waits

  • % of Capture shows % of ITL waits for each top segment compared
  • with total ITL waits for all segments captured by the Snapshot

Owner Tablespace Name Object Name Subobject Name Obj. Type ITL Waits % of Capture
OWNER_Name TS_NAME Object_Name TABLE 188 84.30
OWNER_Name TS_NAME Object_name P_R_06202012 TABLE PARTITION 35 15.70
SOLUTION
The main solution to this issue is to increase the ITL capability of the table or index by re-creating it and altering the INITRANS or PCTFREE parameter to be able to handle more concurrent transactions. This in turn will help to reduce "enq: TX - allocate ITL entry" wait events.

To reduce enq: TX - allocate ITL entry" wait events, We need to follow the steps below:

Increase INITRANS

  1. Depending on the number of transactions in the table we need to alter the value of INITRANS. here it has been changed to 50:

alter table

INITRANS 50;

  1. Then re-organize the table using move (alter table <table_name> move;)

  2. Then rebuild all the indexes of this table as below

alter index <index_name> rebuild INITRANS 50;

Increase PCTFREE
If the issue is not resolved by increasing INITRANS then try increasing PCTFREE. Increasing PCTFREE holds more space back and so spreads the same number of rows over more blocks. This means that there are more ITL slots available, overall.

  1. Spreading rows into more number of blocks will also helps to reduce this wait event.

alter table

PCTFREE 20;
2) Then re-organize the table using move (alter table <table_name> move;)

  1. Rebuild index

alter index index_name rebuild online PCTFREE 20;

A Combination of increasing both INITRANS and PCTFREE

  1. Set INITRANS to 50 and pct_free to 20

alter table <table_name> PCTFREE 20 INITRANS 50;

  1. Re-organize the table using move (alter table <table_name> move;)

  2. Then rebuild all the indexes of the table as below

alter index <index_name> rebuild online PCTFREE 20 INITRANS 50;

NOTE: The table/index can be altered to set the new value for INITRANS. But the altered value takes effect for new blocks only. You need to rebuild the objects so that the blocks are initialized again.

For an index this means the index needs to be rebuild or recreated.

For a table this can be achieved through:
exp/imp
alter table move
dbms_redefenition
You can find information relating to other 'enq: TX - ...' variants in the following articles:

Document 1476298.1 Resolving Issues Where 'enq: TX - row lock contention' Waits are Occurring
Document 873243.1 Troubleshooting 'enq: TX - index contention' Waits in a RAC Environment.
Document 1946502.1 Resolving Issues Where 'enq: TX - contention' Waits are Occurring

REFERENCES
NOTE:549074.1 - How To Modify The Physical Attribute INITRANS For An Existing Table Or Index?

posted @ 2023-08-24 11:41  武汉OracleDBA  阅读(82)  评论(0编辑  收藏  举报