[oradebug命令學習4]HANGANALYZE

尛樣兒發表於2010-05-05
PURPOSE
-------

This article explain how to generate HANGANALYZE trace files to diagnostic database HANG issues.
When a database has a severe performance response time, the cause of the problem can be a HANG. 
Using HANGANALYZE trace files you can determine whether an Oracle process is blocking other processes, 
before starting a performance analysis.
 

Caution: HANGANALYZE run at levels higher that 3 may generate a huge number of trace files for large systems. 
Do not use levels higher than 3 without discussing their effects with Oracle Support. 


STEPS TO GENERATE A HANGANALYZE TRACE FILE:
======================================== 
Use the following set of commands to generate HANGANALYZE trace files.


1- Using SQL*Plus connect as "INTERNAL" (Oracle8i) or "/ AS SYSDBA" (Oracle9i)
 
2- Execute the following commands:
   SQL> oradebug hanganalyze 3 
   ... Wait at least 1 minutes to give time to identify process state changes.
   SQL> oradebug hanganalyze 3 

3- Open a separate SQL session and immediately generate a system state dump.

           $ sqlplus '/ as sysdba'
          oradebug setmypid
          oradebug unlimit
          oradebug dump systemstate 266
          wait 90 seconds
          oradebug dump systemstate 266
          wait 90 seconds
          oradebug dump systemstate 266
          quit


Note: Starting with Oracle 9.2 HANGANALYZE can generate HANGANALYZE cluster wide.
Using this feature you can generate session dependencies to all the sessions 
connected to all the instances of the RAC cluster. Use the following set of commands 
to generate a RAC cluster wide HANGANALYZE:

1- Using SQL*Plus connect as "/ AS SYSDBA" 
2- Execute the following commands:
   SQL> oradebug setmypid 
   SQL> oradebug setinst all
   SQL> oradebug -g def hanganalyze 3
   ... Wait at least 1 minutes to give time to identify process state changes.
   SQL> oradebug -g def hanganalyze 3


FYI:
====
   Due to BUG 1427041 running HANGANALYZE may terminate the instance 
   This is fixed in 8.1.7.3


RELATED DOCUMENTS
----------------- Note:215858.1 - Interpreting HANGANALYZE trace files to diagnose hanging and performance problems 

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/23135684/viewspace-662007/,如需轉載,請註明出處,否則將追究法律責任。

相關文章