Oracle sqlplus失去响应解决方法/如何在数据库失去响应时转储状态信息(转)

某云平台出现故障,sqlplus连接Oracle数据库,发现没有响应。数据库版本:12.1.0.2.0

查找、借鉴前人经验,成功处理此问题,参考网址:如何在数据库失去响应时转储状态信息 - Oracle Life - 云和恩墨,成就所托!  http://www.eygle.com/archives/2007/10/sqlplus_prelim.html

如下内容摘自恩墨博文:

“”在某些情况下,数据库失去响应,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中修正。“

-------------------------------------------------------------------------------------------------------摘录内容结束

通过上述文档,并对prelim参数信息查询后了解到:sqlplus -prelim是Oracle 10G新增的一个特性,它使得Oracle挂起时依然能使用sqlplus,从而能获得数据库状态。此时,并不会创建新的session,而是连接到SGA区。

对于Oracle hang住这种情况,prelim是一个比较有力的工具。

参考网址:

Oracle sqlplus prelim 参数介绍 - CSDN博客  http://blog.csdn.net/tianlesoftware/article/details/4980545

如何在数据库失去响应时转储状态信息 - Oracle Life - 云和恩墨,成就所托!  http://www.eygle.com/archives/2007/10/sqlplus_prelim.html(恩墨的技术还是可以的,有兴趣的同学可以多看看该处博文)

 

posted @ 2018-03-21 20:35  VNX  阅读(1061)  评论(0编辑  收藏  举报