Archive

Posts Tagged ‘oracle ltom’

LTOM - Oracle数据库故障诊断工具介绍

June 3rd, 2009 wajoynece No comments

LTOM 是Oracle官方提供的嵌入式在线的系统数据采集和诊断工具,有三个功能:

  • Automatic Hang Detection
  • System Profiler
  • Automatic Session Tracing

官方介绍:

The Lite Onboard Monitor (LTOM) is a java program designed as a real-time diagnostic platform for deployment to a customer site. LTOM differs from other support tools, as it is proactive rather than reactive. LTOM provides real-time automatic problem detection and data collection. LTOM runs on the customer’s UNIX server, is tightly integrated with the host operating system and provides an integrated solution for detecting and collecting trace files for system performance issues. The ability to detect problems and collect data in real-time will hopefully reduce the amount of time it takes to solve problems and reduce customer downtime.

可以从metalink下载ltom412.tar

tar xvf ltom412.tar

参考README进行安装

oracle@wayne-laptop:~/tools/ltom/tom_base/install$ ./autoinstall.sh
TOM_HOME=/home/oracle/tools/ltom/tom_base/install/../tom
rm: cannot remove `autoinstall.log’: No such file or directory

Preparing to install LTOM v4.0.0…

Checking your Oracle Environment…

ORACLE_HOME=/home/oracle/app/10.2.0/db_1
ORACLE_SID=ora10g
TNS_ADMIN=
TOM_HOME=/home/oracle/tools/ltom/tom_base/install/../tom

Is this the correct Oracle environment you wish to use for installing LTOM?
Hit Return to Accept Default:
============================> \c

Continuing the install with this environment

Checking for Java…

./autoinstall.sh: line 176: /tmp/jstout.txt: Permission denied
Java found.

Checking for top utility…
Found top utility.

Checking for vmstat utility…
Found vmstat utility.

Need to run some sql now to create TOM user
Hit Return to allow setup to do this for you, enter other to do this manually:
============================> \c

Tom user created successfully.
Warning…Please change tom password immediately!

Grant user Tom successful.
Create package dbmssupp successful.
Grant execute on dbmssupp successful.

Checking for statspack…
Found statspack.

Enter your email id to get notification of hangs via email…
Hit Return to ignore hang notification via email:
============================> \c

Configuring tom_deploy.properties file…

TOM/LTOM successfully installed.

Please review any messages you received above.

REMEMBER: You must have TOM_HOME defined and java in your PATH
before you can run TOM/LTOM.

安装后需要设置TOM_HOME,然后就可以启动了

oracle@wayne-laptop:~/tools/ltom/tom_base/tom$ export TOM_HOME=`pwd`
oracle@wayne-laptop:~/tools/ltom/tom_base/tom$ echo $TOM_HOME
/home/oracle/tools/ltom/tom_base/tom
oracle@wayne-laptop:~/tools/ltom/tom_base/tom$ ./startltom.sh
Enter username:tom
Enter your password:****

Starting LTOM V4.1.2
LTOM written by Oracle Center of Expertise
Copyright (c)  2008 by Oracle Corporation

Enter 1  to Start Auto Hang Detection
Enter 2  to Stop  Auto Hang Detection
Enter 3  to Start System Profiling
Enter 4  to Stop  System Profiling
Enter 7  to Start Session Tracing
Enter 71 to Display Sessions Traced
Enter 72 to Dump All Trace Buffers
Enter 73 to Dump Specific Trace Buffer
Enter 74 to Stop Specific Session Tracing
Enter 8  to Stop All Session Tracing

Enter S  to Update status
Enter Q  to End Program
CURRENT STATUS: HangDetection=OFF Profiling=OFF AutoRec=OFF SessionRec=OFF

下面,使用1进入Auto Hang Detection,在数据库中模拟library cache pin事件;下面就可以看到相应的挂起信息

Please Select an Option:1

Enter polling frequency in seconds
(Hit return to accept default value of 20 seconds): 5

Enter 1  to Start Auto Hang Detection
Enter 2  to Stop  Auto Hang Detection
Enter 3  to Start System Profiling
Enter 4  to Stop  System Profiling
Enter 7  to Start Session Tracing
Enter 71 to Display Sessions Traced
Enter 72 to Dump All Trace Buffers
Enter 73 to Dump Specific Trace Buffer
Enter 74 to Stop Specific Session Tracing
Enter 8  to Stop All Session Tracing

Enter S  to Update status
Enter Q  to End Program
CURRENT STATUS: HangDetection=ON Profiling=OFF AutoRec=OFF SessionRec=OFF
Please Select an Option:
>>> LTOM has detected a hang at Tue Jun  2 18:36:31 CST 2009
exit value was 1
cmd was rm /home/oracle/tools/ltom/tom_base/tom/tmp/ltomholdfilename.out
HANGANALYZE Level 3 started Tue Jun  2 18:36:31 CST 2009
exit value was 1
cmd was rm /home/oracle/tools/ltom/tom_base/tom/tmp/hangmail.tmp
exit value was 127
cmd was /home/oracle/tools/ltom/tom_base/tom/src/ltommail.sh
HANGANALYZE completed Tue Jun  2 18:36:31 CST 2009
exit value was 1
cmd was rm /home/oracle/tools/ltom/tom_base/tom/tmp/fname.out
exit value was 1
cmd was cat UNKNOWN
>ERROR PROCESSING FILE. MOST LIKELY CAUSE IS A DELETED FILE: UNKNOWN
This cmd failed: cat UNKNOWN
exit value was 1
cmd was rm /home/oracle/tools/ltom/tom_base/tom/tmp/holdfilename.out
SYSTEMSTATE DUMP Level 266 started Tue Jun  2 18:36:31 CST 2009
SYSTEMSTATE DUMP completed Tue Jun  2 18:36:33 CST 2009
exit value was 1
cmd was rm /home/oracle/tools/ltom/tom_base/tom/tmp/fname.out
SYSTEMSTATE DUMP in file UNKNOWN
HANGANALYZE Level 3 started Tue Jun  2 18:37:03 CST 2009
HANGANALYZE completed Tue Jun  2 18:37:03 CST 2009
exit value was 1
cmd was rm /home/oracle/tools/ltom/tom_base/tom/tmp/fname.out
exit value was 1
cmd was cat UNKNOWN
>ERROR PROCESSING FILE. MOST LIKELY CAUSE IS A DELETED FILE: UNKNOWN
This cmd failed: cat UNKNOWN
SYSTEMSTATE DUMP Level 266 started Tue Jun  2 18:37:03 CST 2009
SYSTEMSTATE DUMP completed Tue Jun  2 18:37:04 CST 2009
exit value was 1
cmd was rm /home/oracle/tools/ltom/tom_base/tom/tmp/fname.out
SYSTEMSTATE DUMP in file UNKNOWN

>>> Exiting autohangdetect thread…

……
CURRENT STATUS: HangDetection=OFF Profiling=OFF AutoRec=OFF SessionRec=OFF
Please Select an Option:q

>>> Beginning shutdown. Waiting for all threads to be notified…

>>> Thread 0 is main still waiting to be notified of shutdown…

>>> LTOM successfully shut down.

The following output was produced from running LTOM…

Auto Hang Detection Logs located in $TOM_HOME/hanglog
Other hang trace files may be located in the udump/bdump

进入$TOM_HOME/hanglog查看

>>>WARNING. Hang detected!
>>>Hang Detected while running query. SID= 144
Event= library cache pin  Secs_In_Wait= 48
Tue Jun  2 18:36:31 CST 2009
>>>Info Only…
Total sessions waiting on significant events = 1
Total sessions waiting on rule specified event = 1

进一步可以通过hanganalyze log 和 ubump目录下的system state dump文件获取详细信息。

其他两项功能也比较实用……

Categories: Oracle Tags: