温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

怎么使用hanganalyze

发布时间:2021-11-09 10:36:26 来源:亿速云 阅读:131 作者:iii 栏目:关系型数据库

本篇内容主要讲解“怎么使用hanganalyze”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“怎么使用hanganalyze”吧!

hanganalyze 和systemstate还是不同的,hanganalyze 里面会有清晰的等待链、等待时间、callstack等,比较轻量级。systemstate 相对hanganalyze 信息较多,会有很多proces和session的信息,还会有shared pool的信息,但是看等待链比较吃力。

1.命令

(1)单实例
SQL>oradebug setmypid 
SQL>oradebug unlimit 
SQL>oradebug hanganalyze 3 
等1~2分钟 
SQL>oradebug hanganalyze 3 
等1~2分钟 
SQL>oradebug hanganalyze 3 
(2).RAC
SQL>oradebug setmypid 
SQL>oradebug unlimit 
SQL>oradebug -g all hanganalyze 3 
等1~2分钟 
SQL>oradebug -g all hanganalyze 3 
等1~2分钟 
SQL>oradebug -g all hanganalyze 3

2.解读trace文件

(1).State of nodes

([nodenum]/cnode/sid/sess_srno/session/ospid/state/start/finish/[adjlist]/predecessor):

[894]/0/895/60406/0xba362838/17792/NLEAF/261/264/[908]/1004

[908]/0/909/3031/0xba3754c8/16376/LEAF/262/263//894

[1004]/0/1005/23626/0xba3f61c8/18465/NLEAF/405/406/[894][908]/none

nodenum:定义每个session的序列号

sid:session的sid

sess_srno:session的Serial#

ospid:OS的进程ID

state:node的状态

adjlist:表示blocker node

predecessor:表示waiter node

State有如下几种状态:

(1)IN_HANG:如果Session处于这种状态,表示Session遇到deadlock或者处于hung状态。

(2)LEAF/LEAF_NW:这些Session通常是“blocker”或者是等待某些资源的“slow” node,通过字段“predecessor” 可以很容易标识出这些node。

(3)NLEAF:这些Session通常被认为是“stuck”会话,意味着这些Session在等待某些Session的资源。通过字段“adjlist”可以很容易的定义该进程的blocker。

(4)IGN/IGN_DMP:这些Session通常是IDLE Session。

(5)SINGLE_NODE and SINGLE_NODE_NW 与leaf和leaf_nw相同,只是它们没有依赖于它们的进程

根据上述信息可以得出:

[1004] block [894][908]

[894] block [908]

(2).CYCLES 处于死锁状态的会话之间的进程依赖性

Cycle 1 : <sid/sess_srno/proc_ptr/ospid/wait_event> :
    <980/3887/0xe4214964/24065/latch free>
 -- <2518/352/0xe4216560/24574/latch free>
 -- <55/10/0xe41236a8/13751/latch free>

(3).Found blocker会话,通常情况是1个session block了很多session会在这部分显示

Found 21 objects waiting for <sid/sess_srno/proc_ptr/ospid/wait_event>
    <55/10/0xe41236a8/13751/latch free>
Found 12 objects waiting for <sid/sess_srno/proc_ptr/ospid/wait_event>
    <2098/2280/0xe42870d0/3022/db file scattered read>
Found 12 objects waiting for <sid/sess_srno/proc_ptr/ospid/wait_event>
    <1941/1783/0xe41ac9e0/462/No Wait>
Found 12 objects waiting for <sid/sess_srno/proc_ptr/ospid/wait_event>
    <980/3887/0xe4214964/24065/latch free>

(4).Chain 等待链上涉及的会话。等待链意味着一个会话正在阻塞一个或多个其他会话。

Open chains found:
Chain 1 : <cnode/sid/sess_srno/proc_ptr/ospid/wait_event> :
    <0/909/3031/0xbcc5dc48/16376/SQL*Net message from client>
 -- <0/895/60406/0xbcc54448/17792/enq: TX - row lock contention>
 -- <0/1005/23626/0xbcc5fc48/18465/enq: TX - row lock contention>

(5).Other chains found 不是被Open chains上链阻塞的进程

Chain 2 : <cnode/sid/sess_srno/proc_ptr/ospid/wait_event> :
    <0/820/40757/0xbcc61448/20057/jobq slave wait>
Chain 3 : <cnode/sid/sess_srno/proc_ptr/ospid/wait_event> :
    <0/882/36187/0xbcc68448/19717/jobq slave wait>
Chain 4 : <cnode/sid/sess_srno/proc_ptr/ospid/wait_event> :
    <0/985/3438/0xbcc50448/20054/No Wait>
Chain 5 : <cnode/sid/sess_srno/proc_ptr/ospid/wait_event> :
    <0/1072/2/0xbcbf3448/20322/Streams AQ: qmn slave idle wait>
Chain 6 : <cnode/sid/sess_srno/proc_ptr/ospid/wait_event> :
    <0/1079/2/0xbcbf0448/20117/Streams AQ: waiting for time man>
Chain 7 : <cnode/sid/sess_srno/proc_ptr/ospid/wait_event> :
    <0/1085/1/0xbcbed448/20070/Streams AQ: qmn coordinator idle>

到此,相信大家对“怎么使用hanganalyze”有了更深的了解,不妨来实际操作一番吧!这里是亿速云网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI