Latch: cache buffer chains (%)

maohaiqing0304發表於2014-12-30


原連結:https://docs.oracle.com/cd/B16240_01/doc/doc.102/e16282/oracle_database_help/oracle_database_wait_bottlenecks_latch_cache_buffer_chains_pct.html 


Latch: cache buffer chains (%)

Description

The cache buffers chains latches are used to protect a buffer list in the buffer cache. These latches are used when searching for, adding, or removing a buffer from the buffer cache.

Blocks in the buffer cache are placed on linked lists (cache buffer chains) which hang off a hash table. The hash chain that a block is placed on is based on the DBA and CLASS of the block. Each hash chain is protected by a single child latch. Processes need to get the relevant latch to allow them to scan a hash chain for a buffer so that the linked list does not change underneath them.

Contention on this latch usually means that there is a block that is in great contention (known as a hot block).

Metric Summary

The rest of the information in this section is only valid for this metric when it appears in either the Enterprise Manager Grid Control or the Enterprise Manager Database Control (if applicable).

The following table shows how often the metric's value is collected and compared against the default thresholds. The 'Consecutive Number of Occurrences Preceding Notification' column indicates the consecutive number of times the comparison against thresholds should hold TRUE before an alert is generated.

Target Version

Evaluation and Collection Frequency

Upload Frequency

Operator

Default Warning Threshold

Default Critical Threshold

Consecutive Number of Occurrences Preceding Notification

Alert Text

pre-10g

Every Minute

After Every Sample

>

20

Not Defined

3

%value%%% of service time is spent waiting on the 'latch: cache buffer chains' event.

Data Source

(DeltaLatchCacheBufferChainsTime/DeltaServiceTime)*100 where:

  • DeltaLatchCacheBufferChainsTime: difference of 'sum of time waited for sessions of foreground processes on the 'latch: cache buffer chains' event' between sample end and start

  • DeltaServiceTime: difference of 'sum of time waited for sessions of foreground processes on events not in IdleEvents + sum of 'CPU used when call started' for sessions of foreground processes' between sample end and start

See Idle Events

User Action

To identify the heavily accessed buffer chain, and hence the contended for block, look at latch statistics for the cache buffers chains latches using the V$LATCH_CHILDREN view. If there is a specific cache buffers chains child latch that has many more GETS, MISSES, and SLEEPS when compared with the other child latches, then this is the contended for child latch.

This latch has a memory address, identified by the ADDR column.


SELECT 
      addr,
      sleeps
FROM 
      v$latch_children c,
      v$latchname n
WHERE
      n.name='cache buffers chains' and
      c.latch#=n.latch# and
      sleeps > 100
ORDER BY sleeps
/


Use the value in the ADDR column joined with the V$BH view to identify the blocks protected by this latch. For example, given the address (V$LATCH_CHILDREN.ADDR) of a heavily contended latch, this queries the file and block numbers:


SELECT file#, dbablk, class, state, TCH
  FROM X$BH
  WHERE HLADDR='address of latch';


X$BH.TCH is a touch count for the buffer. A high value for X$BH.TCH indicates a hot block.

Many blocks are protected by each latch. One of these buffers will probably be the hot block. Any block with a high TCH value is a potential hot block. Perform this query a number of times, and identify the block that consistently appears in the output.

After you have identified the hot block, query DBA_EXTENTS using the file number and block number to identify the segment.

Related Topics

About Alerts

About the Metric Detail Page

Editing Thresholds

Understanding Line Charts

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28602568/viewspace-1385292/,如需轉載,請註明出處,否則將追究法律責任。

相關文章