2024年3月10日发(作者:)

由于我们经常进行一些危险边缘的操作,数据库吴地进入了无响应状态,也就是我们最常

说的Hung住了(至今所有的中文oracle书籍用的全是统一的“Hung住”这样的中西方结合

的拉轰方式,hold住姐只能算后辈!)。这时连sqlplus都不能连库了,怎么搞?

从Oracle10g开始,sqlplus提供了一个参数选项-prelim,用这个参数,在系统已经

hang的时候。我们可以连接到SGA而不是数据库,也就是说没有session被创建。下面简单

介绍下这个参数。

一. 通过以下步骤可以获取系统信息:

sqlplus -prelim / as sysdba

oradebug setmypid

oradebug unlimit;

oradebug dump systemstate 10

对于9i的老库,可以通过安装10g的客户端连接 9iR2工作正常。

二. prelim参数特点

1.首先在数据库上启用10046事件:

SQL> alter system set events ‘10046 trace name context forever’;

System altered.

2. 先用普通的方式连接:

[oracle@dbp ~]$ sqlplus /nolog

SQL*Plus: Release 11.2.0.1.0 Production on Wed Sep 19 12:52:16 2012

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

SQL> conn / as sysdba

Connected.

SQL> exit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 -

64bit Production

With the Partitioning, Automatic Storage Management, OLAP, Data Mining

and Real Application Testing options