Friday, March 1, 2013

ORACLE - ITL waits for RAC Tuning

What is ITL waits ?

By default INITRANS value for table is 1 and for index is 2. When too many concurrent DML transactions are competing for the same data block we observe this wait event - " enq: TX - allocate ITL entry".

Once the table or index is reorganized by altering the INITRANS or PCTFREE parameter, it helps to reduce "enq: TX - allocate ITL entry" wait events.

To know more details, In the AWR report, search for the section "Segments by ITL Waits"  .

select statistic_name, value from v$segment_statistics where object_name = 'JTABLE' ;

STATISTIC_NAME                                              VALUE
----------------------------------------------------------------
logical reads                                                             15549760
buffer busy waits                                                       300
gc buffer busy                                                           4060
db block changes                                                      8228480
physical reads                                                           1855428
physical writes                                                          1438352
physical reads direct                                                  0
physical writes direct                                                 0
gc cr blocks received                                               861836
gc current blocks received                                        1262791
ITL waits                                                                 0
row lock waits                                                          98

space used                                                               19127971
space allocated                                                         134217728
segment scans                                                           11

This shows that this table was subject to 15549760 logical reads on this instance since the startup.
The number goes up, of course. The view is specific to each node. The important line is:
ITL waits                                                                 0
This shows that this table did not suffer any ITL waits. There could be locking; but not ITL waits.
Also, locks could be seen from:
row lock waits                                                           98
This also means pure row locks, not due to undo segment, etc. have occurred only 98 times on this instance since the startup.

Check ITL issue:
SELECT OWNER,OBJECT_NAME FROM V$SEGMENT_STATISTICS
WHERE STATISTIC_NAME = 'ITL waits' AND VALUE > 0;

Solution:
 1) Depending on the amount of transactions in the table we need to alter the value of INITRANS:
alter table <table name> INITRANS 60;
alter index <index_name> rebuild INITRANS 60;

2)Spreading rows into more number of blocks will also helps to reduce this wait event :
alter index <index_name> rebuild PCTFREE 80;
alter table <table_name> PCTFREE 40  INITRANS 80;

2 comments:

  1. hi,

    We are using ASM in RAC ..so its is necessary to set those parameter.

    PLz suggest.

    ReplyDelete
  2. Hello,

    We Observed deadlock issue on my db ,especilly for some tables, will it help use by increasing
    the ini_trans for tables and their indexes, pls suggest.

    And we are using 11g RAC with ASM.

    PLzz suggest

    ReplyDelete