eygle Eygle.
FAQ 2007-10-25

如何在数据库失去响应时转储状态信息

在某些情况下,数据库失去响应,sqlplus也无法连接,此时通常只能通过杀掉进程来解决。

但是我们仍然希望能够获得此时的数据库状态信息,以便用于事后诊断。
从Oracle10g开始,sqlplus提供了一个参数选项-prelim,可以在通常sqlplus无法连接的情况下进行连接。
通过以下步骤可以获取系统信息:
sqlplus -prelim / as sysdba
oradebug setmypid
oradebug unlimit;
oradebug dump systemstate 10

这种方法非常有用:

$ sqlplus -prelim / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Oct 25 09:42:20 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL>

但是需要注意的是,在Oracle 10.2.0.1中,使用如上方法会出现一个错误:

$ sqlplus -prelim / as sysdba

SQL*Plus: Release 10.2.0.1.0 - Production on Thu Oct 25 09:38:14 2007

Copyright (c) 1982, 2005, Oracle. All rights reserved.

SQL> oradebug setmypid
Statement processed.
SQL> oradebug unlimit
Statement processed.
SQL> oradebug dump systemstate 10
ORA-03113: end-of-file on communication channel
ORA-24323: value not allowed

此时在alert文件中会记录如下错误提示:
Thu Oct 25 09:38:32 2007
System State dumped to trace file
Thu Oct 25 09:38:32 2007
Errors in file /opt/oracle/admin/test201/udump/test201_ora_1402.trc:
ORA-07445: exception encountered: core dump [kgldmp()+1360] [SIGSEGV] [Address not mapped to object] [0x000000030] [] []
这是由于一个Bug导致的,Bug号为5730231,该Bug在10.2.0.3中修正。

记录一下!

-The End-

By eygle 2007-10-25 09:23 评论 (5)
eygle
eygle

前Oracle ACE Director,云和恩墨创始人。技术为骨,历史为脉,人文为魂。

返回首页

5 Comments

大师认为10gR2的哪个PatchSet比较稳定?据说10.2.0.3 Bug很多?

这里前一段时间出了这么个故障,可惜是9i的。

这个改进好,以前没办法了就只能kill 了,事后在分析看不到了,比较郁闷,哈哈

我觉得10.2.0.3不错啊,修正了很多由来已久的Bug。

记得有一个Logical Standby的Bug,在Metalink上讨论了一两年,最后在10.2.0.3里修正了。

刚才看了一下,在10g中,如果遇到数据库hang,使用hanganalyze收集信息是否效果更好,比如:
oradebug hanganalyze 3