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/
将504403164211105256 从10进制 转化 成 16 机制70000016262ce00
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
##########ps
Collection commands for Hanganalyze and Systemstate: Non-RAC:
Sometimes, database may actually just be very slow and not actually hanging. It is therefore recommended, where possible to get 2 hanganalyze and 2 systemstate dumps in order to determine whether processes are moving at all or whether they are "frozen".
Hanganalyze
sqlplus '/ as sysdba'
oradebug setmypid
oradebug unlimit
oradebug hanganalyze 3
-- Wait one minute before getting the second hanganalyze
oradebug hanganalyze 3
oradebug tracefile_name
exit
Systemstate
sqlplus '/ as sysdba'
oradebug setmypid
oradebug unlimit
oradebug dump systemstate 266
oradebug dump systemstate 266
oradebug tracefile_name
exit
Collection commands for Hanganalyze and Systemstate: RAC
There are 2 bugs affecting RAC that without the relevant patches being applied on your system, make using level 266 or 267 very costly. Therefore without these fixes in place it highly unadvisable to use these level
For information on these patches see:
Document 11800959.8 Bug 11800959 - A SYSTEMSTATE dump with level >= 10 in RAC dumps huge BUSY GLOBAL CACHE ELEMENTS - can hang/crash instances
Document 11827088.8 Bug 11827088 - Latch 'gc element' contention, LMHB terminates the instance
Note: both bugs are fixed in 11.2.0.3.
Collection commands for Hanganalyze and Systemstate: RAC with fixes for bug 11800959 and bug 11827088
For 11g:
sqlplus '/ as sysdba'
oradebug setorapname reco
oradebug unlimit
oradebug -g all hanganalyze 3
oradebug -g all hanganalyze 3
oradebug -g all dump systemstate 266
oradebug -g all dump systemstate 266
exit
Collection commands for Hanganalyze and Systemstate: RAC without fixes for Bug 11800959 and Bug 11827088
sqlplus '/ as sysdba'
oradebug setorapname reco
oradebug unlimit
oradebug -g all hanganalyze 3
oradebug -g all hanganalyze 3
oradebug -g all dump systemstate 258
oradebug -g all dump systemstate 258
exit
For 10g, run oradebug setmypid instead of oradebug setorapname reco:
sqlplus '/ as sysdba'
oradebug setmypid
oradebug unlimit
oradebug -g all hanganalyze 3
oradebug -g all hanganalyze 3
oradebug -g all dump systemstate 258
oradebug -g all dump systemstate 258
exit
In RAC environment, a dump will be created for all RAC instances in the DIAG trace file for each instance.
#########sample 1:
刚开始以为是CBC LATCH . 后面发现还是SQL 性能问题,需要调优SQL ,因为 statuts 是"WAITED SHORT TIME", so "latch: cache buffers chains" is NOT current want event, it is last wait event
<==== session "State" column shows "WAITED SHORT TIME", so "latch: cache buffers chains" is NOT current want event, it is last wait event
V$SESSION_WAIT中的常用列
SID: session标识 EVENT: session当前等待的事件,或者最后一次等待事件。 WAIT_TIME: session等待事件的时间(单位,百分之一秒)如果本列为0,说明session当前session还未有任何等待。 SEQ#: session等待事件将触发其值自增长 P1, P2, P3: 等待事件中等待的详细资料 P1TEXT, P2TEXT, P3TEXT: 解释说明p1,p2,p3事件
附注: 1.State字段有四种含义﹕ Waiting:SESSION正等待这个事件。 Waited unknown time:由于设置了timed_statistics值为false,导致不能得到时间信息。表示发生了等待,但时间很短。 Wait short time:表示发生了等待,但由于时间非常短不超过一个时间单位,所以没有记录。 Waited knnow time:如果session等待然后得到了所需资源,那么将从waiting进入本状态。
Wait_time值也有四种含义: 值>0:最后一次等待时间(单位:10ms),当前未在等待状态。 值=0:session正在等待当前的事件。 值=-1:最后一次等待时间小于1个统计单位,当前未在等待状态。 值=-2:时间统计状态未置为可用,当前未在等待状态。
3.Wait_time和Second_in_wait字段值与state相关: 如果state值为Waiting,那么wait_time值无用。Second_in_wait值
<==== session "State" column shows "WAITED SHORT TIME", so "latch: cache buffers chains" is NOT current want event, it is last wait event
ORACLE CBC LATCH 检查的更多相关文章
- oracle执行先决条件检查失败的解决方法
在安装oracle 11g时,出现执行先决条件失败的情况如下: 你可以忽略所有强制安装,一般不会影响功能,但如果你想知道为什么会产生这种错误, 并且当出现以上情况时又该如何解决呢?如下列出了原因和解决 ...
- [Oracle] Lock&Latch梳理
Oracle lock&latch 1. 概述 4种锁机制 lock latch pin mutex 保证资源在并发访问和修改时不被破坏 锁类型 行为 持有时间 级别 保护类型 lock 队列 ...
- oracle dg状态检查及相关命令
oracle dg 状态检查 先检查备库的归档日志同步情况 SELECT NAME,applied FROM v$archived_log; alter database recover manage ...
- 读取模式下cbc latch的事件模拟(热块竞争和热链竞争)-P62
文章目录 1. 背景 2. 过程 2.1 热块竞争 2.1.1 版本11.2.0.1.0 2.1.1.1 session 1(sid:34) 2.1.1.2 session 2(sid:35) 2.1 ...
- Oracle内部latch获取函数简介
标签: oracle call 函数 oracle statpack 转自: http://blog.51cto.com/458302/998775 Oracle的内部函数一直非常神秘,其 ...
- 安装Oracle进行先决条件检查时显示 Environment variable:"PATH" 失败”
问题已解决:安装时exe可执行文件的目录也不能有中文,安装时注意目录一定要按oracle的格式.运行安装程序时,要用右键--> 要以管理员方式启动. 原文: 用到oracle数据库,由于电脑装的 ...
- Oracle 过程中检查数据表存在与否
在过程中,尤其是每天执行的任务,通常要检查查询的数据表存在不存在,如果不存在则等待一段时间在进行执行,以下代码实现了这个功能,如果表不存在,抛出异常,交给异常处理代码,确保数据完整性 使用方法:p_C ...
- Oracle EBS-SQL (MRP-7):检查MRP计划运行报错原因之超大数据查询2.sql
/*逐一运行检查计划运行超大数据*/ ---------------------------------------------------- -- PO Requisitions select * ...
- Oracle EBS-SQL (MRP-6):检查MRP计划运行报错原因之超大数据查询1.sql
/*逐一运行检查计划运行超大数据*/ ---------------------------------------------------- /*查询-1*/ select plan_id, 'C ...
随机推荐
- 最短路径Dijkstar算法和Floyd算法详解(c语言版)
博客转载自:https://blog.csdn.net/crescent__moon/article/details/16986765 先说说Dijkstra吧,这种算法只能求单源最短路径,那么什么是 ...
- 数字图像处理实验(4):PROJECT 02-04 [Multiple Uses],Zooming and Shrinking Images by Bilinear Interpolation 标签: 图像处理MATLAB
实验要求: Zooming and Shrinking Images by Bilinear Interpolation Objective To manipulate another techniq ...
- Windows7 安装TensorFlow(本人试了好多方法后的成果)
本人机器为64位win7 首先安装python,版本一定要注意,TennsorFlow要使用 Python3.0 系列版本不能使用2.0系列版本,但是TensorFlow 的安装包目前windows版 ...
- wifi下远程连接Android设备方法
问题描述: android开发真机调试过程中,我们总是会重复卸载.安装这两个过程进行调试,通常都是用数据线连接电脑,能否摆脱数据线呢? 无线调试: 前提条件,电脑和手机必须处于同一局域网. 1.手机通 ...
- windows10系统连接蓝牙鼠标自动断开解决方案
环境: Windows 10 企业版 2016 长期服务版 罗技M590 问题: 鼠标长时间未使用,会自动断开 解决步骤: 参考链接: https://zhidao.baidu.com/questio ...
- 使用metasploit进行栈溢出攻击-3
有了shellcode,就可以进行攻击了,但是要有漏洞才行,真实世界中的漏洞很复杂,并且很难发现,因此我专门做一个漏洞来进行攻击. 具体来说就是做一个简单的tcp server,里面包含明显的栈溢出漏 ...
- 个人JS体系整理(二)
一. eval eval()函数计算JavaScript字符串,并把它作为脚本代码来执行.如果参数是一个表达式,eval()函数将执行表达式.如果参数是Javascript语句,eval()将执行Ja ...
- 洛谷 P4297 [NOI2006]网络收费
P4297 [NOI2006]网络收费 题目背景 noi2006 day1t1 题目描述 网络已经成为当今世界不可或缺的一部分.每天都有数以亿计的人使用网络进行学习.科研.娱乐等活动.然而,不可忽视的 ...
- 洛谷P4074 [WC2013]糖果公园(莫队)
传送门 总算会树形莫队了…… 上次听说树形莫队是给树分块,实在看不懂.然后用括号序列的方法做总算能弄明白了 先说一下什么是括号序列,就是在$dfs$的时候,进入的时候记录一下,出去的时候也记录一下 拿 ...
- 2019年GPLT L2-3 深入虎穴 比赛题解 中国高校计算机大赛-团体程序设计天梯赛题解
著名的王牌间谍 007 需要执行一次任务,获取敌方的机密情报.已知情报藏在一个地下迷宫里,迷宫只有一个入口,里面有很多条通路,每条路通向一扇门.每一扇门背后或者是一个房间,或者又有很多条路,同样是每条 ...