实验操作环境:操作系统: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<!--CRLF--> 2: lsnrctl stop LISTENER<!--CRLF--> 3: sleep 15<!--CRLF--> 4: sqlplus /nolog <<EOF<!--CRLF--> 5: conn / as sysdba;<!--CRLF--> 6: alter system switch logfile;<!--CRLF--> 7: alter system checkpoint;<!--CRLF--> 8: shutdown immediate;<!--CRLF--> 9: exit<!--CRLF-->10: EOF<!--CRLF-->在另外一个会话中使用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-orasvr02bdump]$ tailalert_epps.log<!--CRLF--> 2: Current log# 3 seq# 242223 mem# 1: /u02/oradata/epps/redo03_01.log<!--CRLF--> 3: Sun Jan 5 05:14:50 2014<!--CRLF--> 4: Starting control autobackup<!--CRLF--> 5: Control autobackup written to DISK device<!--CRLF--> 6: handle "/u01/app/oracle/product/10.2.0/db_1/dbs/c-2179993557-20140105-0e"<!--CRLF--> 7: Sun Jan 5 05:14:54 2014<!--CRLF--> 8: ALTER SYSTEM ARCHIVE LOG<!--CRLF--> 9: Sun Jan 5 05:14:55 2014<!--CRLF-->10: Thread 1 cannot allocate new log, sequence 242224<!--CRLF-->11: Checkpoint not complete<!--CRLF-->12: Current log# 3 seq# 242223 mem# 0: /u01/app/oracle/oradata/epps/redo03_1.log<!--CRLF-->13: Current log# 3 seq# 242223 mem# 1: /u02/oradata/epps/redo03_01.log<!--CRLF-->14: Sun Jan 5 05:14:58 2014<!--CRLF-->15: Thread 1 advanced to log sequence 242224 (LGWR switch)<!--CRLF-->16: Current log# 5 seq# 242224 mem# 0: /u01/app/oracle/oradata/epps/redo05_1.log<!--CRLF-->17: Current log# 5 seq# 242224 mem# 1: /u02/oradata/epps/redo05_02.log<!--CRLF-->18: Sun Jan 5 07:31:56 2014<!--CRLF-->19: Thread 1 advanced to log sequence 242225 (LGWR switch)<!--CRLF-->20: Current log# 2 seq# 242225 mem# 0: /u01/app/oracle/oradata/epps/redo02_1.log<!--CRLF-->21: Current log# 2 seq# 242225 mem# 1: /u02/oradata/epps/redo02_02.log<!--CRLF-->22: Sun Jan 5 07:32:20 2014<!--CRLF-->23: Starting background process EMN0<!--CRLF-->24: Shutting down instance: further logons disabled<!--CRLF-->25: EMN0 started with pid=43, OS id=7062<!--CRLF-->26: Sun Jan 5 07:32:21 2014<!--CRLF-->27: Stopping background process CJQ0<!--CRLF-->28: Sun Jan 5 07:32:21 2014<!--CRLF-->29: Stopping background process QMNC<!--CRLF-->30: Sun Jan 5 07:32:23 2014<!--CRLF-->31: Stopping background process MMNL<!--CRLF-->32: Sun Jan 5 07:32:34 2014<!--CRLF-->33: Background process MMNL not dead after 10 seconds<!--CRLF-->34: Sun Jan 5 07:32:34 2014<!--CRLF-->35: Killing background process MMNL<!--CRLF-->36: Sun Jan 5 07:32:35 2014<!--CRLF-->37: Stopping background process MMON<!--CRLF-->38: Sun Jan 5 07:33:05 2014<!--CRLF-->39: Background process MMON not dead after 30 seconds<!--CRLF-->40: Sun Jan 5 07:33:05 2014<!--CRLF-->41: Killing background process MMON<!--CRLF-->42: Sun Jan 5 07:33:06 2014<!--CRLF-->43: Shutting down instance (immediate)<!--CRLF-->44: License high water mark = 561<!--CRLF-->45: Sun Jan 5 07:33:06 2014<!--CRLF-->46: Stopping Job queue slave processes, flags = 7<!--CRLF-->47: Sun Jan 5 07:33:06 2014<!--CRLF-->48: Process OS id : 6088 alive after kill<!--CRLF-->49: Errors in file /u01/app/oracle/admin/epps/udump/epps_ora_7055.trc<!--CRLF-->50: Sun Jan 5 07:33:09 2014<!--CRLF-->51: Waiting for Job queue slaves to complete<!--CRLF-->52: Sun Jan 5 07:33:09 2014<!--CRLF-->53: Job queue slave processes stopped<!--CRLF-->54: Sun Jan 5 07:38:10 2014<!--CRLF-->55: Active call for process 11121 user "oracle" program "oracle@get-orasvr02 (S000)"<!--CRLF-->56: Active call for process 7162 user "oracle" program "oracle@get-orasvr02 (S011)"<!--CRLF-->57: SHUTDOWN: waiting for active calls to complete.<!--CRLF-->58: Sun Jan 5 07:57:28 2014<!--CRLF-->59: Waiting for dispatcher "D000" to shutdown<!--CRLF-->60: Waiting for dispatcher "D001" to shutdown<!--CRLF-->61: Waiting for dispatcher "D002" to shutdown<!--CRLF-->62: Waiting for dispatcher "D003" to shutdown<!--CRLF-->63: Waiting for dispatcher "D004" to shutdown<!--CRLF-->64: Waiting for dispatcher "D005" to shutdown<!--CRLF-->65: Waiting for dispatcher "D006" to shutdown<!--CRLF-->66: Sun Jan 5 07:59:29 2014<!--CRLF-->67: All dispatchers and shared servers shutdown<!--CRLF-->68: Sun Jan 5 08:04:30 2014<!--CRLF-->69: SHUTDOWN: Active processes prevent shutdown operation<!--CRLF-->70: Sun Jan 5 08:09:32 2014<!--CRLF-->71: SHUTDOWN: Active processes prevent shutdown operation<!--CRLF-->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 back2) Any temporary space (sort segments / lobs / session temporary tables) must be freed3) The session itself and any associated memory consumed by the session.4) Internal locks / enqueues must be cleaned upOften 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://www.linuxidc.com/Linux/2014-01/95419.htmhttp://www.linuxidc.com/Linux/2014-01/95418.htmhttp://www.linuxidc.com/Linux/2013-07/87895.htm更多Oracle相关信息见Oracle 专题页面 http://www.linuxidc.com/topicnews.aspx?tid=12 Oracle 11g中SYS连接阻止关闭数据库Oracle使用STORED OUTLINE固化执行计划--CURSOR_SHARING相关资讯 HANG住 shutdown immediate
- Shutdown immediate命令长时间等待 (08/22/2015 09:04:35)
- drop用户hang住解决思路 (01/23/2014 20:02:19)
- 如何处理HANG住的DB (12/12/2013 09:17:17)
| - shutdown immediate一直停在那里 (04/26/2014 10:22:54)
- 批量错误用户名与密码导致业务用户 (01/09/2014 17:38:05)
|
本文评论 查看全部评论 (0)