首页 » ORACLE 9i-23c » Troubleshooting Oracle 11g ‘latch free’ 166# “mostly latch-free SCN”

Troubleshooting Oracle 11g ‘latch free’ 166# “mostly latch-free SCN”

近期一个客户oracle 11g 11.2.0.4 的环境, 业务出现拥堵, 活动会话的等待事件是latch free, 并且P2# 显示是一个不常见的mostly latch-free SCN ,简单记录.

现象如下

latch free 根据p2值可以查找latchname.

从上图看166# latch是一个不常见的latch类型MOSTLY LATCH-FREE SCN

分析方法

SQL>oradebug setmypid
SQL>oradebug unlimit;
SQL>oradebug dump systemstate 266;

oradebug -g all hanganalyze 4


@latchprof sid,name % % 100000
@latchprof sid,name,laddr % cache 100000
@latchprof sid,name,laddr % [laddr value above] 100000

Advanced Oracle Troubleshooting Guide, Part 7: Sampling latch holder statistics using LatchProf

@latchprofx    <#samples>
@latchprofx sid,name % % 100000
@latchprofx sid,name % library 1000000   

Tanelpoder的脚本latchprofx和 latchprof 区别一个是v$和x$,来源v$latchholder;

原因

简而言之就是过去oracle版本用这个latch 保护scn,SCN 最初受到latch的保护,因为它是 6 个字节,而且我们在只能执行 32 位原子加载的 32 位处理器上运行。 如今,大多数处理器都是 64 位的,并且具有 64 位加载指令和 64 位 CAS 指令。 ub8 的非锁定读取可用于自动获取当前 SCN 值。 64 位比较和交换可用于分配新的 SCN。 因此,在支持 64 位负载和 CAS 的平台上不再需要latch。

解决方法

安装one-off patch , 或升级12.2以后

打赏

,

对不起,这篇文章暂时关闭评论。