Oracle 使用 ass.awk 工具查看 system state dump 說明

來源:互聯網
上載者:User

 

 

如果Oracle資料庫hang住了,對Oracle做system dump,或做 hang analyze,是研究和解決問題的有效辦法。如果能夠串連資料庫,並能夠進行操作,那麼用oradebug是簡單快捷的辦法。

 

OracleHANGANALYZE 功能診斷 DBhanging

http://blog.csdn.net/tianlesoftware/article/details/6321961

 

Oracleoradebug 命令 使用說明

http://blog.csdn.net/tianlesoftware/article/details/6525628

 

 

SYS@anqing1(rac1)> oradebug setmypid

Statement processed.

SYS@anqing1(rac1)> oradebug dump systemstate 10

Statement processed.

SYS@anqing1(rac1)> oradebug tracefile_name

/u01/app/oracle/admin/anqing/udump/anqing1_ora_8725.trc

SYS@anqing1(rac1)> oradebug close_trace

Statement processed.

 

在系統hung的時候,systemstate基本等同於hanganalyze,可以用於診斷system hung。但是如果直接來查看這個trace file,比較麻煩,這時候可以使用ass.awk 指令碼來協助我們查看trace file。

 

Ass.Awk 指令碼在LTOM的ltom431\ltom\tom_base\tom\src目錄下,其名稱是:ass109.awk。這個是目前的最新版本,ass.awk 指令碼可以協助我們分析和格式化system state dump。

 

LTOM的MOS說明:

LTOM - TheOn-Board Monitor User Guide [ID 352363.1]

 

LTOM 的:

http://download.csdn.net/detail/tianlesoftware/4047944

 

在看AWK, awk是一種程式設計語言,用於在linux/unix下對文本和資料進行處理。資料可以來自標準輸入、一個或多個檔案,或其它命令的輸出。

 

關於AWK的更多內容參考:

Linux awk 命令 說明

http://blog.csdn.net/tianlesoftware/article/details/6278273

 

 

我們這裡使用的是AWR命令的 -fscripfile 參數,即從指令檔中讀取awk命令。這個指令碼就是我們LTOM中的ass109.awk。

 

樣本:

[oracle@rac1 src]$ awk -f ass109.awk /u01/app/oracle/admin/anqing/udump/anqing1_ora_8725.trc

 

Starting Systemstate 1

...................................

Ass.Awk Version 1.0.9 - Processing/u01/app/oracle/admin/anqing/udump/anqing1_ora_8725.trc

 

System State 1

~~~~~~~~~~~~~~~~

1:                                     

2: waiting for 'pmon timer'           wait

3: waiting for 'DIAG idle wait'       wait

4: waiting for 'rdbms ipc message'    wait

5: waiting for 'rdbms ipc message'    wait

6: waiting for 'ges remote message'   wait

7: waiting for 'gcs remote message'   wait

8: waiting for 'rdbms ipc message'    wait

9: waiting for 'rdbms ipc message'    wait

10: waiting for 'rdbms ipc message'     wait

11: waiting for 'rdbms ipc message'     wait

12: waiting for 'buffer busy waits'(2,89,21) wait

13: waiting for 'rdbms ipc message'     wait

14: waiting for 'enq: JS - queue lock'[Enqueue JS-00000000-00000001] wait

15: waiting for 'buffer busy waits'(2,89,21) wait

16: waiting for 'rdbms ipc message'     wait

17:                                    

18:                                    

19: waiting for 'rdbms ipc message'     wait

20: waiting for 'log file switch (archivingneeded)' wait

21: waiting for 'ASM background timer'  wait

22: waiting for 'rdbms ipc message'     wait

23: waiting for 'log file switch (archivingneeded)' wait

24: last wait for 'SQL*Net message fromclient'

25: for 'Streams AQ: waiting for messagesin the queue' wait

26: waiting for 'Streams AQ: qmn slave idlewait' wait

27: waiting for 'rdbms ipc message'     wait

28: waiting for 'rdbms ipc message'     wait

29: waiting for 'class slave wait'      wait

30:                                    

31: waiting for 'Streams AQ: qmncoordinator idle wait' wait

32: waiting for 'SQL*Net message fromclient' wait

34: waiting for 'SQL*Net message fromclient' wait

36: waiting for 'jobq slave wait'       wait

37: for 'Streams AQ: waiting for timemanagement or cleanup tasks' wait

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

Enqueue JS-00000000-00000001    23: waiting for 'log file switch (archivingneeded)'

 

Object Names

~~~~~~~~~~~~

Enqueue JS-00000000-00000001                                 

 

 

48768 Lines Processed.

[oracle@rac1 src]$

 

 

這個使用ass.awk 處理之後的結果就直接查看trace 直觀很多:

[oracle@rac1 src]$ head -100/u01/app/oracle/admin/anqing/udump/anqing1_ora_8725.trc  

/u01/app/oracle/admin/anqing/udump/anqing1_ora_8725.trc

Oracle Database 10g Enterprise EditionRelease 10.2.0.4.0 - Production

With the Partitioning, Real ApplicationClusters, OLAP, Data Mining

and Real Application Testing options

ORACLE_HOME =/u01/app/oracle/product/10.2.0/db_1

System name:    Linux

Node name:      rac1

Release:        2.6.18-194.el5

Version:        #1 SMP Tue Mar 16 21:52:43 EDT 2010

Machine:       i686

Instance name: anqing1

Redo thread mounted by this instance: 1

Oracle process number: 24

Unix process pid: 8725, image: oracle@rac1(TNS V1-V3)

 

*** 2012-02-06 20:32:20.758

*** ACTION NAME:() 2012-02-06 20:32:20.755

*** MODULE NAME:(sqlplus@rac1 (TNS V1-V3))2012-02-06 20:32:20.755

*** SERVICE NAME:(SYS$USERS) 2012-02-0620:32:20.755

*** SESSION ID:(118.34295) 2012-02-0620:32:20.755

===================================================

SYSTEM STATE

------------

System global information:

    processes: base 0x30e0ec78, size 150, cleanup 0x30e1dff8

    allocation: free sessions 0x30e5a6c4, free calls (nil)

    control alloc errors: 0 (process), 0 (session), 0 (call)

    PMON latch cleanup depth: 0

    seconds since PMON's last scan for dead processes: 64

    system statistics:

313621 logons cumulative

30 logons current

14842838 opened cursors cumulative

….

 

 

 

 

 

-------------------------------------------------------------------------------------------------------

著作權,文章允許轉載,但必須以連結方式註明源地址,否則追究法律責任!

Email:   tianlesoftware@gmail.com

Skype: tianlesoftware

Blog:     http://www.tianlesoftware.com

Weibo: http://weibo.com/tianlesoftware

Twitter: http://twitter.com/tianlesoftware

Facebook: http://www.facebook.com/tianlesoftware

 

-------加群需要在備忘說明Oracle資料表空間和資料檔案的關係,否則拒絕申請----

DBA1 群:62697716(滿);   DBA2 群:62697977(滿)  DBA3 群:62697850(滿)  

DBA 超級群:63306533(滿);  DBA4 群:83829929   DBA5群: 142216823

DBA6 群:158654907    DBA7 群:172855474   DBA總群:104207940

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.