首页 > 数据库 > Oracle > HANGFG User Guide (Doc ID 362094.1)

HANGFG User Guide (Doc ID 362094.1)

原创 Oracle 作者:rongshiyuan 时间:2014-04-01 16:07:41 0 删除 编辑
HANGFG User Guide (Doc ID 362094.1)

The Hang File Generator(HANGFG) User Guide

Carl Davis, Center of Expertise

Best Practices

Pro-Active Problem Avoidance and Diagnostic Collection

Although some problems may be unforeseen, in many cases problems may be avoidable if signs are detected early enough. Additionally, if an issue does occur, it is no use collecting information about that issue after the event. HANGFG is one of the tools that support recommend for collecting such diagnostics. For information on suggested uses, other proactive preparations and diagnostics, see:

Document 1482811.1 Best Practices: Proactively Avoiding Database and Query Performance Issues
Document 1477599.1 Best Practices Around Data Collection For Performance Issues



HANGFG (Hang file generator) is a series of unix shell  scripts used to automate the generation and collection of hanganalyze and   systemstate trace files. HANGFG generates and collects hang trace files based on  the impact of taking diagnostic traces on a system which is already in a  degraded state. The overall decision on what level of impact the user can afford  is left up to the user when he runs HANGFG, as the level of impact is passed in  as an argument to the tool. HANGFG is also capable of making this decision for  the user if the user selects light or medium impact (option 1 or 2) as an argument to the tool.  HANGFG is RAC aware and can run in either a RAC or non RAC environment.

Back to Contents



One of the major problems with obtaining the necessary  diagnostic information to diagnose database hanging problems is having the  necessary diagnostic data collected while the problem is actually occurring.  Additionally, the necessary diagnostic data is seldom collected because of the  time it takes to react to recognizing there is a problem, trying to determine  what kind of data to collect, and knowing how to collect the data. Frequently,  the problem has passed or the database has to be shutdown to correct the  problem. HANGFG automates the generation and collection of hang diagnostic  traces. The user need only run one diagnostic, HANGFG, during the database hang.  The commands to issue the generation of diagnostic traces are performed by  HANGFG, thus freeing the user from having to know and issue the individual  cryptic commands to the database to generate these traces. HANGFG will also look  to see how badly a system is degraded before issuing any commands that could  degrade the system even further. Finally HANGFG will collect all the trace files  that are produced from issuing these commands as well as any other oracle trace  file that gets updated from the time the first hang diagnostic is performed.  This greatly increases the probability that all the necessary hang related  diagnostic traces are collected at one time thereby reducing the amount of  pinging between the user and Oracle support for requests for additional  diagnostic data requests.

Back to Contents


Supported Platforms

  • Solaris
  • Linux
  • HP-UX
  • AIX
  • Tru64

Back to Contents


Download  HANGFG

Current HANGFG Version: 1.3.0   October 25, 2012

Click here to download the file .

If a file download dialog box does not appear when clicking on the above link, you may need to clear your web browser's cache and/or restart your web browser. If you are still unable to download the file, you may request that we email you a copy:

Back to Contents


Installing HANGFG

Download of HANGFG is available through MetaLink and can be downloaded as a tar  file. The user can then copy the tar file to the directory where HANGFG is to be  installed and issues the following command: 

tar xvf hangfg.tar

This will create a directory called hangfg.  The  hangfg files are then untar'd into this new directory.  Next, make
sure to change the file permissions on these files to execute by using the chmod command.

Back to Contents


Uninstalling HANGFG

To uninstall HANGFG issue the following command on the  hangfg directory:

rm -rf hangfg

Back to Contents


Running  HANGFG

To run HANGFG standalone go to the directory hangfg and  issue the following command:


This script takes 1 argument which controls the number and  level of detail of the hang trace files generated.

ARG1 = level of impact (1, 2 or 3).

ARG1 Description
1 Light impact on system. This option collects 2   hanganalyze level 3 traces and then determines whether it can also collect 1   hanganalyze level 4 trace with minimal impact to the system. If so, it   collects the hanganalyze level 4 trace. If not, it does not collect an   additional trace file.
2 Medium impact on system       (default value). This option collects 1 hanganalyze level 3 trace and then       determines whether it can also collect 2 hanganalyze level 4 traces with minimal impact to the system. If so, it   collects the 2 additional hanganalyze level 4 traces. If not, it collects an       additional hanganalyze level 3 trace. This option also collects 1 systemstate       level 258 trace.
3 Heavy impact on system. This option collects 2   hanganalyze level 4 traces and 2 systemstate level 258 traces.

If you do not enter any argument the script runs with a  default value of 2 meaning collect trace files with a medium impact on the  system.

Example 1

./ 3

This would start the tool and collect traces with the  heaviest impact on the system ( 2 hanganalyze level 4 traces and 2 systemstate  dumps).


Example 2


Hangfg called without an argument uses the  default value of medium impact on the system ( 1 hanganalyze level 3 trace,  followed by additional hanganalyze level 3 or 4 traces, followed by 1 systemstate dump).

Back to Contents


RAC Environment

HANGFG is RAC aware. If the node you are running on is  part of a RAC cluster the hanganalyze and systemstate dump commands are issued  with the -g option. If the current node where you are running hangfg is hung you  will be given a notification and asked to run hangfg from another node in the  cluster. HANGFG finds all files on all nodes in the cluster and lists these  files along with nodename in the file hangfiles.out. HANGFG bundles all the  trace files from all the nodes and puts them into one compressed tar file  named hfiles_.tar.Z where MMDDYYHHMI is the date and time that the  file was generated.

Back to Contents

Output Files

HANGFG creates hang trace files in the respective udump  and bdump directories. In addition the following files are also generated in the  directory where you are running hangfg.

  1. hangfiles.out  - This file contains a list of all files   generated during the hang. This is the list of files you need to send into   support for analysis.
  2. hangfg.log  -  This file contains a log of the hangfg   program. This file is useful for debugging any issues that may arise along   with logging all actions associated with the hangfg program.
  3. hfiles_.tar.Z  - This file contains a compressed tarball of   all hang traces collected by the hangfg program. It also contains the file   hangfiles.out.

Back to Contents

Reporting Feedback

If you encounter problems running HANGFG or would like to provide feedback, please send email to

Legal Notices and Terms of Use



来自 “ ITPUB博客 ” ,链接:,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录


  • 博文量
  • 访问量