ORACLE CBC LATCH 检查
Posted feiyun8616的作坊 (半个程序员and dba)
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ORACLE CBC LATCH 检查相关的知识,希望对你有一定的参考价值。
###############
1.DB meet latch: cache buffers chains event
from awr report ,check
latch: cache buffers chains
point to "kcbgtcr: fast path
As far as I remember, this code path only happens for indexe.since it is a hot block:
2.https://blog.pythian.com/tuning-latch-contention-cache-buffers-chain-latches/ (重要)
following : no use ,beacuse sql_id can‘t point sql_text.it is starnge ,no sql_text in v$sql.
select /*+ materialize*/* from DBA_HIST_ACTIVE_SESS_HISTORY
where
sample_time between to_date(‘2018-12-14 16:00:00‘,‘yyyy-mm-dd hh24:mi:ss‘)
and to_date(‘2018-12-14 16:30:00‘,‘yyyy-mm-dd hh24:mi:ss‘)
and event=‘latch: cache buffers chains‘
2.1.following : CBC point to RANGE SCAN INDEX
p1:504403164211105256
p2:155
PLAN:INDEX
SQL_PLAN:RANGE SCAN
http://tool.oschina.net/hexconvert/
select hladdr, file#, dbablk, decode(state,1,‘cur ‘,3,‘CR‘,state) ST, tch
from x$bh where hladdr in
(select addr from (select addr from v$latch_children where addr=‘70000016262ce00‘
order by sleeps, misses,immediate_misses desc )where rownum <2)
4.no time to check hot block,because it is prod, we first kill all session to make app normal.
MOSC has this script to locate a hot block:
select /*+ RULE */
e.owner ||‘.‘|| e.segment_name segment_name,
e.extent_id extent#,
x.dbablk - e.block_id + 1 block#,
x.tch,
l.child#
from
sys.v$latch_children l,
sys.x$bh x,
sys.dba_extents e
where
x.hladdr = ‘ADDR‘ and
e.file_id = x.file# and
x.hladdr = l.addr and
x.dbablk between e.block_id and e.block_id + e.blocks -1
##########change to awr find the suspect index segment, find the oorder by logicel read segment index
Segments by Logical Reads DB/Inst: EMS/ems Snaps: 51672-51673
EMSOPR EMS_DATA FND_ATM_ATTACHMENT_M INDEX 312,744,640 56.88
suspect the hot block is FND_ATM_ATTACHMENT_MULTI_N1
I_name:FND_ATM_ATTACHMENT_MULTI_N1
T_name:FND_ATM_ATTACHMENT_MULTI
以上是关于ORACLE CBC LATCH 检查的主要内容,如果未能解决你的问题,请参考以下文章