본문 바로가기

Oracle

latch: cache buffers chains 이런 대기 이벤트 발생중입니다..

Latch: cache buffers chains 래치를 대기 하는 이유는 다음과 같습니다.

쿼리에서 원하는 블록을 버퍼 캐시에서 찾기 위해서는 버퍼 캐시를 탐색하기 위한 래치를 획득 해야 합니다.

이 래치가 cache buffers chains 래치 입니다.

그럼 해당 이벤트가 발생하는 이유는 내가 버퍼를 탐색하기 위하여 대기를 하였다는 것입니다.

즉 다른 세션에서 수행중인 SQL문에 의하여 해당 하는 블록을 찾기 위하여 cache buffers chains 래치를 오래 획득하고 있다는 소리지요 ..

해결방안은 단순히 버퍼 캐시를 늘려 주신것이 아니라 해당 쿼리를 찾아서 튜닝을 통하여 엑세스 하는 블록을 줄여 주셔야 합니다.

DML이 수행될 경우 다른 세션에서 해당 블록의 이전 이미지 값을 찾기 위해서는 원본 데이터 블록 + Undo Image 블록을 같이 엑세스 해야 합니다.

10.2.0.2 버젼이라면 concurrent index scan시에 느려지는 버그가 있는데 현상은 cache buffer chain 을 대기하지요. 정확하게 Wait Event를 모니터링을 해서 cache buffer chain latch를 과다하게 대기하는 쿼리가 같은 쿼리인지.. p1, p2값에서 나오는 블록이 index 인지 확인이 필요하겠습니다. 만약에 그렇다면 해당 패치가 필요하겠구요..

Note:4742607.8
Bug 4742607 - "cache buffer chains" latch contention from concurrent index range scans

Versions confirmed as being affected 9.2.0.7 10.1.0.5 10.2.0.2

This issue is fixed in
9.2.0.8 (Server Patch Set)
10.2.0.3 (Server Patch Set)
11g (Future version)


Description
Concurrent index range-scan initializations can lead to contention on the
"cache buffers chains" hash latches due to latch upgrades.

This can show as high "shared hash latch upgrade" statistic counts
and high "latch free" wait events, and in extreme situations, excessive
CPU consumption without any user-SQL activity.