一:当时的情景
SQL> shutdown immediate
--无任何返回结果
二:问题定位过程
1.查询相关进程只有ORACLE的关键进程存在
ps -ef |grep ora_
soadb 4487 1 0 22:57:05 ? 0:00 ora_reco_soadbprd soadb 4485 1 5 22:57:05 ? 0:00 ora_smon_soadbprd soadb 4526 1 0 22:57:15 ? 0:00 ora_arc0_soadbprd soadb 4479 1 0 22:57:04 ? 0:00 ora_dbw1_soadbprd soadb 4483 1 0 22:57:04 ? 0:01 ora_ckpt_soadbprd soadb 4468 1 0 22:57:02 ? 0:02 ora_pmon_soadbprd
2.查看alter日志,显示如下:
Shutting down instance: further logons disabled Thu Nov 14 22:04:24 2013 Stopping background process CJQ0 Thu Nov 14 22:04:24 2013 Stopping background process QMNC Thu Nov 14 22:04:26 2013 Stopping background process MMNL Thu Nov 14 22:04:27 2013 Stopping background process MMON Thu Nov 14 22:04:27 2013 Shutting down instance (immediate) License high water mark = 152 Thu Nov 14 22:04:27 2013 Stopping Job queue slave processes, flags = 7 Thu Nov 14 22:04:27 2013 Job queue slave processes stopped Waiting for dispatcher 'D000' to shutdown All dispatchers and shared servers shutdown Thu Nov 14 22:04:30 2013 ALTER DATABASE CLOSE NORMAL Thu Nov 14 22:09:34 2013 Waiting for smon to disable tx recovery. Thu Nov 14 22:23:46 2013 MMNL absent for 1201 secs; Foregrounds taking over
3.针对红色字体的提示,查询官方网站,ID 1076161.6
官方描述如下:
During shutdown the SMON process is cleaning up extents and updating the data dictionary tables with the marked free extents. As the extents are marked as freed, they are removed from the table for used extents, UET$ and placed on the table for free extents, FET$.
官方描述的原因是因为smon进程在清时临时表空间数据块和更新数据字典时造成的数据库HANG住,原理讲的很清楚,里面还有一个链接,一个是讲述这种情况可能是一个BUG,另一个链接教我们诊断数据库HANG住的具体原因。但现在的问题是,如果一直等下去,可能需要几个小时,此次变更数据库重启只有半小时时间,不可能待下去,怎么办?
4.尝试取消shutdown immediate命令
CTRAL + C没有任何作用,新建一个链接执行查询或其它操作,会报一个错,具体信息如下:
ORA-01089: immediate shutdown in progress - no operations are permitted
可以看到,此时什么都不允许操作,这时想找从操作系统上找到shutdown immediate进程KILL掉,后来仔细一想,这个操作可能比shutdown abort更危险,很可能造成数据库无法启动,在网上找到了相关资源,也没找到办法,此时突然想到刚学ORACLE数据库启动和停止时有一条命令是
startup force:中止当前数据库的运行,并开始重新正常的启动数据库
startup force = shutdown abort +startup 此时也只能用它了
5.强制停止shutdown immediate
新打开一个sqlplus / as sysdba
SQL> startup force ORACLE instance started.
Total System Global Area 3206836224 bytes Fixed Size 2180024 bytes Variable Size 1778388040 bytes Database Buffers 1409286144 bytes Redo Buffers 16982016 bytes Database mounted. Database opened.
此时shutdown immediate窗口停止了,数据库恢复到可操作状态,此时我再次用shutdown immediate命令再次正常停止数据库,依然无法停止,没办法,再次执行startup force获取数据库控制权,选择shutdown abort方法停止数据库。重新启动,很幸运,启动成功了!(