DBPedias

All your database knowledge are belong to you

Oracle

Wait Events - buffer latch

buffer latch

The session waits on the buffer hash chain latch. Primarily used in the dump routines, this is not a very common wait event. Wait Time:

1 second

Parameters:

  • latch addr This is the virtual address in the SGA where this latch is located. You can find the name of this latch with the following command:
    select *
      from v$latch a, v$latchname b
     where addr = latch addr
       and a.latch# = b.latch#;
  • chain# This is the index into array of hash chains. When a chain is 0xfffffff we are waiting on the LRU latch. Otherwise the chain is the index in the number of hash chains. Database buffers are basically hashed by their DBA to a particular hash chain. The number of hash chains is calculated by dividing the number of buffers by 4 and rounding up to the first prime number. A thousand db_block_buffers, would mean 251 hash hash buckets. You can also dump the SGA in oradbx and find the variable kcbnhb (hash buckets) and kcbnbh (number of buffers). Dumping the SGA with the following SQL statement is also possible:
    alter session
          set events 'immediate trace name heapdump level 10';

    Or if you have access to x$ksppi:

    select ksppinm, ksppivl
      from x$ksppi
     where ksppinm = '_db_block_hash_buckets';
This will display the number of hash buckets before it has been converted to a prime number.

This is only a problem for dumping trace information. It is recommended that this event be ignored unless a process is hanging on it.