某云平台出现故障,sqlplus链接Oracle数据库,发现没有响应。数据库版本:12.1.0.2.0html
查找、借鉴前人经验,成功处理此问题,参考网址:如何在数据库失去响应时转储状态信息 - Oracle Life - 云和恩墨,成就所托! http://www.eygle.com/archives/2007/10/sqlplus_prelim.htmlsql
以下内容摘自恩墨博文:数据库
“”在某些状况下,数据库失去响应,sqlplus也没法链接,此时一般只能经过杀掉进程来解决。session
可是咱们仍然但愿可以得到此时的数据库状态信息,以便用于过后诊断。
从Oracle10g开始,sqlplus提供了一个参数选项-prelim,能够在一般sqlplus没法链接的状况下进行链接。
经过如下步骤能够获取系统信息:oracle
sqlplus -prelim / as sysdba oradebug setmypid oradebug unlimit; oradebug dump systemstate 10
这种方法很是有用:app
$ 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文件中会记录以下错误提示:spa
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中修正。“.net
-------------------------------------------------------------------------------------------------------摘录内容结束debug
经过上述文档,并对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(恩墨的技术仍是能够的,有兴趣的同窗能够多看看该处博文)