怎么使用hanganalyze

31次阅读
没有评论

共计 3111 个字符,预计需要花费 8 分钟才能阅读完成。

本篇内容主要讲解“怎么使用 hanganalyze”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让丸趣 TV 小编来带大家学习“怎么使用 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”有了更深的了解,不妨来实际操作一番吧!这里是丸趣 TV 网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!

正文完
 
丸趣
版权声明:本站原创文章,由 丸趣 2023-07-24发表,共计3111字。
转载说明:除特殊说明外本站除技术相关以外文章皆由网络搜集发布,转载请注明出处。
评论(没有评论)