如何分析解读systemstat dump产生的trc文件

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了如何分析解读systemstat dump产生的trc文件相关的知识,希望对你有一定的参考价值。

    ORACLE数据库的systemstat dump生成trace文件虽然比较简单,但是怎么从trace文件中浩如烟海的信息中提炼有用信息,并作出分析诊断是一件技术活,下面收集、整理如何分析解读systemstat dump产生的trace文件。

    如果要人工去解读systemstat dump生成的trace文件,真是一件体力活,因为这些trace文件动不动就几百M甚至更大,它产生的跟踪文件包含了系统中所有进程的进程状态等信息。每个进程对应跟踪文件中的一段内容,反映该进程的状态信息,包括进程信息,会话信息,enqueues信息(主要是lock的信息),缓冲区的信息和该进程在SGA区中持有的(held)对象的状态等信息。dump systemstate产生的跟踪文件是从dump那一刻开始到dump任务完成之间一段事件内的系统内所有进程的信息。 我们需要的是找到导致问题出现的进程的信息,然后根据进程的信息判断导致问题出现的root cause,并在分析问题后解决问题。

   幸好网上有人写了这个一个工具ass109.awk ,可以节约分析systemstat dump文件或跟踪文件(trace file)的时间,可以将trace文件中关键信息梳理、整理出来,当然如果了解详细信息,还是必须人工去解读。下面贴上一个例子,是我在学习中的一个案例,本人也是在学习、研究过程中,如有分析不对的地方敬请指出

[[email protected] udump]$ awk -f ass109.awk  scm2_ora_25575.trc 
 
Starting Systemstate 1
.................................................
Starting Systemstate 2
....................................................
Starting Systemstate 3
....................................................
Ass.Awk Version 1.0.9 - Processing scm2_ora_25575.trc
 
System State 1
~~~~~~~~~~~~~~~~
1:                                      
2:  waiting for ‘pmon timer‘            
3:  waiting for ‘rdbms ipc message‘     
4:  waiting for ‘rdbms ipc message‘     
5:  waiting for ‘rdbms ipc message‘     
6:  waiting for ‘rdbms ipc message‘     
7:  waiting for ‘rdbms ipc message‘     
8:  last wait for ‘smon timer‘          
9:  waiting for ‘rdbms ipc message‘     
10: waiting for ‘rdbms ipc message‘     
11: waiting for ‘rdbms ipc message‘     
12: waiting for ‘rdbms ipc message‘     
13: waiting for ‘SQL*Net message from client‘[Latch 855675ae0] 
     Cmd: Select
14: waiting for ‘SQL*Net message from client‘[Latch 8556759a0] 
     Cmd: Select
15: waiting for ‘SQL*Net message from client‘ 
     Cmd: Select
16: waiting for ‘SQL*Net message from client‘[Latch 855675720] 
17: waiting for ‘SQL*Net message from client‘[Latch 8556755e0] 
     Cmd: Insert
18: waiting for ‘SQL*Net message from client‘[Latch 8556755e0] 
     Cmd: Select
19: waiting for ‘SQL*Net message from client‘[Latch 8556755e0] 
     Cmd: Select
20: waiting for ‘SQL*Net message from client‘[Latch 8556755e0] 
     Cmd: Select
21: waiting for ‘SQL*Net message from client‘[Latch 8556755e0] 
     Cmd: Insert
22: waiting for ‘virtual circuit status‘ 
     Cmd: Select
23:                                     
24:                                     
25: waiting for ‘virtual circuit status‘ 
     Cmd: Select
26:                                     
27: waiting for ‘virtual circuit status‘ 
     Cmd: Select
28:                                     
29: waiting for ‘latch: shared pool‘   [Latch 8556759a0] 
     Cmd: Select
30:                                     
31: waiting for ‘virtual circuit status‘ 
     Cmd: Select
33: waiting for ‘jobq slave wait‘       
34:                                     
35:                                     
36: waiting for ‘Streams AQ: qmn slave idle wait‘ 
37: waiting for ‘rdbms ipc message‘     
38: waiting for ‘rdbms ipc message‘     
39: waiting for ‘rdbms ipc message‘     
40: waiting for ‘rdbms ipc message‘     
41: waiting for ‘rdbms ipc message‘     
42: waiting for ‘rdbms ipc message‘     
43: waiting for ‘rdbms ipc message‘     
44: waiting for ‘rdbms ipc message‘     
45: waiting for ‘rdbms ipc message‘     
46: waiting for ‘rdbms ipc message‘     
47: waiting for ‘Streams AQ: qmn coordinator idle wait‘ 
49: for ‘Streams AQ: waiting for time management or cleanup tasks‘ 
58:                                     
61: waiting for ‘virtual circuit status‘ 
     Cmd: Select
Blockers
~~~~~~~~
 
        Above is a list of all the processes. If they are waiting for a resource
        then it will be given in square brackets. Below is a summary of the
        waited upon resources, together with the holder of that resource.
        Notes:
        ~~~~~
         o A process id of ‘???‘ implies that the holder was not found in the
           systemstate.
 
                    Resource Holder State
             Latch 855675ae0    ??? Blocker
             Latch 8556759a0    ??? Blocker
             Latch 855675720    ??? Blocker
             Latch 8556755e0    ??? Blocker
 
Object Names
~~~~~~~~~~~~
Latch 855675ae0 Child library cache           
Latch 8556759a0 Child library cache           
Latch 855675720 Child library cache           
Latch 8556755e0 Child library cache           
 
System State 2
~~~~~~~~~~~~~~~~
1:                                      
2:  waiting for ‘pmon timer‘            
3:  waiting for ‘rdbms ipc message‘     
4:  waiting for ‘rdbms ipc message‘     
5:  waiting for ‘rdbms ipc message‘     
6:  waiting for ‘rdbms ipc message‘     
7:  waiting for ‘rdbms ipc message‘     
8:  waiting for ‘smon timer‘            
9:  waiting for ‘rdbms ipc message‘     
10: waiting for ‘rdbms ipc message‘     
11: waiting for ‘rdbms ipc message‘     
12: waiting for ‘rdbms ipc message‘     
13: waiting for ‘SQL*Net message from client‘[Latch 855675900] 
     Cmd: Select
14: waiting for ‘SQL*Net message from client‘[Latch 855675900] 
     Cmd: Select
15: waiting for ‘SQL*Net message from client‘[Latch 855675900] 
     Cmd: Select
16: waiting for 

以上是关于如何分析解读systemstat dump产生的trc文件的主要内容,如果未能解决你的问题,请参考以下文章

ArrayPool 源码解读之 byte[] 也能池化?

如何获取堆的dump 的信息,如何分析

ArrayPool 源码解读之 byte[] 也能池化?

WinDBG相关

spss 做logistic回归 输出结果如何解读

[JAVA]JAVA章3 如何获取及查看DUMP文件