诊断Oraacle数据库Hanging问题
2007-05-07 12:07:40 来源:WEB开发网核心提示: 对于Oracle 8.0.5.x to 8.1.7.x的版本:$ svrmgrlsvrmgr> connect internalsvrmgr>ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME HANGANALYZE LEVEL
对于Oracle 8.0.5.x to 8.1.7.x的版本:
$ svrmgrl
svrmgr> connect internal
svrmgr>ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME HANGANALYZE LEVEL 3';
wait 90 seconds
svrmgr>ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME HANGANALYZE LEVEL 3';
EXIT ... then reconnect
svrmgr>ALTER SESSION SET MAX_DUMP_FILE_SIZE=UNLIMITED;
svrmgr>ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME SYSTEMSTATE LEVEL 10';
wait 90 seconds
svrmgr>ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME SYSTEMSTATE LEVEL 10';
wait 90 seconds
svrmgr>ALTER SESSION SET EVENTS 'IMMEDIATE TRACE NAME SYSTEMSTATE LEVEL 10';
对于Oracle 9.2.0.1或者更高的版本:$ sqlplus /nolog
connect / as sysdba
oradebug setmypid
oradebug unlimit
oradebug hanganalyze 3
wait 90 seconds
oradebug hanganalyze 3
oradebug dump systemstate 10
wait 90 seconds
oradebug dump systemstate 10
wait 90 seconds
oradebug dump systemstate 10
获取STATPACK的输出报告
对于如何得到和分析statpack的输出报告,可以参考eygle的个人网站上的文章。http://www.eygle.com/archives/2004/11/statspack_list.html
获取PROCESSSTATE的dump
获取processstate dump,可以使用如下命令,建议执行三遍,将可以在user_dump_dest目录下找到生成的跟踪文件。
$ sqlplus "/as sysdba"
oradebug setospid <process ID>
oradebug unlimit
如果要获取errorstacks dump,可以使用如下命令,建议执行三遍,同样可以在user_dump_dest目录下找到生成的跟踪文件。
$ sqlplus "/as sysdba"
oradebug setospid <process ID>
oradebug unlimit
oradebug dump errorstack 3
更多精彩
赞助商链接