共計 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 網站,更多相關內容可以進入相關頻道進行查詢,關注我們,繼續學習!