实验操作环境:

        操作系统:Red Hat Enterprise Linux ES release 4 (Nahant Update 6)                  

        数据库 : Oracle Database 10g Release 10.2.0.4.0 – Production  32bit

今晚使用shutdown immediate(其实是执行stop_oracle.sh脚本关闭数据库,如下所示)关闭数据库的时候,

   1: [oracle@gsp-orasvr02 scripts]$ more stop_oracle.sh

   2: lsnrctl stop LISTENER

   3: sleep 15

   4: sqlplus /nolog <<EOF

   5: conn / as sysdba;

   6: alter system switch logfile;

   7: alter system checkpoint;

   8: shutdown immediate;

   9: exit

  10: EOF

在另外一个会话中使用tail  -20f  命令查看告警日志的输出,结果发现数据库等待了很长时间都没有正常关闭,hang住在下面地方:

Active call for process 11121 user 'oracle' program 'oracle@get-orasvr02 (S000)'

Active call for process 7162 user 'oracle' program 'oracle@get-orasvr02 (S011)'

                                                           截图如下

这时解决办法是找出hang住的进程并杀掉(当时操作没有截图,也没有保存输出信息),因为有些session无法被pmon进程清理,导致数据库无法顺利关闭,需要手工杀掉进程。首先使用ps 和grep找到这两个进程。

[ oracle@get-orasvr02  bdump]$ ps -ef | grep oracle | grep  S000

[ oracle@get-orasvr02  bdump]$ ps -ef | grep oracle | grep  S011

然后使用kill -9  processesid杀掉这两个进程即可,杀掉这两个进程后,从告警日志里面看到里面跳到关闭dispatcher 。如下所示:

   1: [ oracle@get-orasvr02  bdump]$ tail  alert_epps.log

   2:   Current log# 3 seq# 242223 mem# 1: /u02/oradata/epps/redo03_01.log

   3: Sun Jan 5 05:14:50 2014

   4: Starting control autobackup

   5: Control autobackup written to DISK device

   6:         handle '/u01/app/oracle/product/10.2.0/db_1/dbs/c-2179993557-20140105-0e'

   7: Sun Jan 5 05:14:54 2014

   8: ALTER SYSTEM ARCHIVE LOG

   9: Sun Jan 5 05:14:55 2014

  10: Thread 1 cannot allocate new log, sequence 242224

  11: Checkpoint not complete

  12:   Current log# 3 seq# 242223 mem# 0: /u01/app/oracle/oradata/epps/redo03_1.log

  13:   Current log# 3 seq# 242223 mem# 1: /u02/oradata/epps/redo03_01.log

  14: Sun Jan 5 05:14:58 2014

  15: Thread 1 advanced to log sequence 242224 (LGWR switch)

  16:   Current log# 5 seq# 242224 mem# 0: /u01/app/oracle/oradata/epps/redo05_1.log

  17:   Current log# 5 seq# 242224 mem# 1: /u02/oradata/epps/redo05_02.log

  18: Sun Jan 5 07:31:56 2014

  19: Thread 1 advanced to log sequence 242225 (LGWR switch)

  20:   Current log# 2 seq# 242225 mem# 0: /u01/app/oracle/oradata/epps/redo02_1.log

  21:   Current log# 2 seq# 242225 mem# 1: /u02/oradata/epps/redo02_02.log

  22: Sun Jan 5 07:32:20 2014

  23: Starting background process EMN0

  24: Shutting down instance: further logons disabled

  25: EMN0 started with pid=43, OS id=7062

  26: Sun Jan 5 07:32:21 2014

  27: Stopping background process CJQ0

  28: Sun Jan 5 07:32:21 2014

  29: Stopping background process QMNC

  30: Sun Jan 5 07:32:23 2014

  31: Stopping background process MMNL

  32: Sun Jan 5 07:32:34 2014

  33: Background process MMNL not dead after 10 seconds

  34: Sun Jan 5 07:32:34 2014

  35: Killing background process MMNL

  36: Sun Jan 5 07:32:35 2014

  37: Stopping background process MMON

  38: Sun Jan 5 07:33:05 2014

  39: Background process MMON not dead after 30 seconds

  40: Sun Jan 5 07:33:05 2014

  41: Killing background process MMON

  42: Sun Jan 5 07:33:06 2014

  43: Shutting down instance (immediate)

  44: License high water mark = 561

  45: Sun Jan 5 07:33:06 2014

  46: Stopping Job queue slave processes, flags = 7

  47: Sun Jan 5 07:33:06 2014

  48: Process OS id : 6088 alive after kill

  49: Errors in file /u01/app/oracle/admin/epps/udump/epps_ora_7055.trc

  50: Sun Jan 5 07:33:09 2014

  51: Waiting for Job queue slaves to complete

  52: Sun Jan 5 07:33:09 2014

  53: Job queue slave processes stopped

  54: Sun Jan 5 07:38:10 2014

  55: Active call for process 11121 user 'oracle' program 'oracle@get-orasvr02 (S000)'

  56: Active call for process 7162 user 'oracle' program 'oracle@get-orasvr02 (S011)'

  57: SHUTDOWN: waiting for active calls to complete.

  58: Sun Jan 5 07:57:28 2014

  59: Waiting for dispatcher 'D000' to shutdown

  60: Waiting for dispatcher 'D001' to shutdown

  61: Waiting for dispatcher 'D002' to shutdown

  62: Waiting for dispatcher 'D003' to shutdown

  63: Waiting for dispatcher 'D004' to shutdown

  64: Waiting for dispatcher 'D005' to shutdown

  65: Waiting for dispatcher 'D006' to shutdown

  66: Sun Jan 5 07:59:29 2014

  67: All dispatchers and shared servers shutdown

  68: Sun Jan 5 08:04:30 2014

  69: SHUTDOWN: Active processes prevent shutdown operation

  70: Sun Jan 5 08:09:32 2014

  71: SHUTDOWN: Active processes prevent shutdown operation

Oracle的官方文档介绍、解释如下

The database is waiting for pmon to clean up processes, but pmon is unable to

clean them. The client connections to the server are causing the shutdown

immediate or normal to hang. Killing them allows pmon to clean up and release

the associated Oracle processes and resources.

What resources are we talking about?

1) Any non committed transactions must be rolled back

2) Any temporary space (sort segments / lobs / session temporary tables) must be freed

3) The session itself and any associated memory consumed by the session.

4) Internal locks / enqueues must be cleaned up

Often Oracle (SMON or PMON depending on whether Shared Server is used) will wait for the OS to terminate the process(es) associated with the session. If the OS never returns, or fails to terminate them, then the instance shutdown will hang with this message (Shutdown Waiting for Active Calls to Complete)

Other means exist to achieve a quick shutdown, as outlined inNote 386408.1- What Is The Fastest Way To Cleanly Shutdown An Oracle Database?

结果解决上面问题后,本以为可以顺利关闭数据库,结果又hang住了,告警日志信息提示为

SHUTDOWN: Active processes prevent shutdown operation

出现这个错误原因:

因为我大概如下的操作导致:

[oracle@gsp-orasvr02 scripts]$ sqlplus / as sysdba

...........

SQL> !

[oracle@get-orasvr02 ~]$

..... (执行了一些shell 命令)

然后又使用了sqlplus启动登录了数据库,然后做shutdown immediate操作,这时导致shutdown immediate被hang住。

[oracle@gsp-orasvr02 scripts]$ sqlplus / as sysdba

解决办法:退出当前的会话,回到原始会话,并重新连接,就可以正常的关闭数据库了

参考资料:

http://oracle.chinaitlab.com/optimize/761636_2.html

http://blog.csdn.net/xionglang7/article/details/8997081

http://blog.csdn.net/leshami/article/details/9466559

Oracle数据库shutdown immediate被hang住的几个原因的更多相关文章

  1. 如何诊断oracle数据库运行缓慢或hang住的问题

    为了诊断oracle运行缓慢的问题首先要决定收集哪些论断信息,可以采取下面的诊断方法:1.数据库运行缓慢这个问题是常见还是在特定时间出现如果数据库运行缓慢是一个常见的问题那么可以在问题出现的时候收集这 ...

  2. Oracle数据库的经典问题 snapshot too old是什么原因引起的

    Oracle数据库的经典问题 snapshot too old是什么原因引起的 ORACLE经典错误求解:ORA-1555错误(Snapshot too old ) - ... 书上说是因为the r ...

  3. shutdown immediate时 hang住 (转载)

    shutdown immediate 经常关库时hang住,在alert中有 License high water mark = 4All dispatchers and shared servers ...

  4. oracle数据库字符集和客户端字符集(2%)是不同的,字符集转化可能会造成不可预期的后果

    转载请在文章显眼位置注明出处:https://www.cnblogs.com/sunshine5683/p/10036321.html 今天在plsql连接oracle时候报错提示“数据库字符集和客户 ...

  5. df执行hang住

    一.现象 在linux操作系统中,执行df -h命令,后hang住 二.思路 排查是否存在Nfs问题,无法正常挂载nfs路径导致的问题. 三.解决过程 3.1 cat /etc/rc.local #m ...

  6. linux下重启oracle数据库

    如何在linux下重启oracle数据库 | 浏览:3930 | 更新:2013-09-18 19:33 1 2 3 4 5 6 分步阅读 在实际工作项目中,有时候会遇到需要对oracle数据库进行重 ...

  7. 一次数据库hang住的分析过程

    现象: 普通用户和sysdba都无法登陆,业务中断 分析过程: 1.先做hanganalyze和systemstate dump $sqlplus -prelim "/as sysdba&q ...

  8. NDMCDB数据库hang住故障分析 - cursor: pin S wait on X

    问题描写叙述: 上午刚刚到办公室,就有监控人员邮件反馈,昨晚NDMCDB407数据库被重新启动过,让我分析一下数据库重新启动的原因.因为昨晚业务有版本号上线,所以短信警告关闭了,所以没有短信下发到我手 ...

  9. oracle故障处理之删除大表空间hang住

    背景 数据库分区表数据越来越大,需要对过期话的数据进行迁移,以及大的分区表需要进行数据的清理和删除,达到释放磁盘空间的目的. 问题说明 环境:linux 6.X 数据库:oracle 11.2.0.4 ...

随机推荐

  1. php对文本文件进行分页功能简单实现

    php对文本文件进行分页功能简单实现 <!DOCTYPE> <html> <head> <meta http-equiv="Content-type ...

  2. 自己在总结前人经验下弄的几个opencv封装函数

    第一个是增加对比度的函数,就是变亮. IplImage* EqualizeHistColorImage(IplImage *pImage) { IplImage *pEquaImage = cvCre ...

  3. SharePoint Server 2013 让上传文件更精彩

    新版的SharePoint 2013 提供了多种上传与新建文件的方式,对于与系统集成紧密的IE来上传文档更加方便 使用IE开启SharePoint地址 Figure 1打开文档库,在"新颖快 ...

  4. VirtualBox安装Debian6的方法和步骤(详细)

    下面是用VirtualBox安装Debian6的方法和步骤 l 新建一个文件夹,用于存放虚拟硬盘,如Debian l 打开VirtualBox,点击新建 l 输入虚拟机名称,Debian_6 l 给虚 ...

  5. java多线程--定时器Timer的使用

    定时的功能我们在手机上见得比较多,比如定时清理垃圾,闹钟,等等.定时功能在java中主要使用的就是Timer对象,他在内部使用的就是多线程的技术. Time类主要负责完成定时计划任务的功能,就是在指定 ...

  6. c++中的重名问题

    看C++视频教程-范磊主讲(2.91G)视频学习笔记整理. 1.c++为什么要引入名字空间(namespace)? c++引入名字空间这个概念,是为了避免重名问题,比如说避免重复的函数名或者变量名引起 ...

  7. Linux上的SQL Server的起步

    我们知道,几个星期前,微软发布了在Linux上直接运行的SQL Server第一个公开CTP版本!因此,对我来说,是时候跨界在Linux上安装我的第一个SQL安装,这样的话,我就可以在Linux上折腾 ...

  8. Openfire 4.1.0

    http://www.igniterealtime.org/downloads/index.jsp 服务器端口 接口 端口   类型 描述 所有的地址 5222 客户端到服务器 客户端使用标准端口连接 ...

  9. [Q&A] MySQL Error 1050(42S01): Table already exist

    [环境说明] 1:MySQL Server 5.5 2:MyEclipse 2014 3:JDK 1.7 造成该问题的可能原因: 1:用 Java 读取 SQL 文件,并执行其中的 sql 语句,但是 ...

  10. MySQL数据库中delimiter的作用概述

    以下的文章主要是向大家描述的是MySQL数据库中delimiter的作用是什么?我们一般都认为这个命令和存储过程关系不大,到底是不是这样的呢?以下的文章将会给你相关的知识,望你会有所收获. 其实就是告 ...