Experimental operating environment:
Operating system: Red Hat Enterprise Linux ES Release 4 (nahant Update 6)
Databases: Oracle database 10g Release 10.2.0.4.0–production 32bit
Tonight using shutdown immediate (actually executing the stop_oracle.sh script to close the database, as shown below) when shutting down the database,
1: [[email protected] 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
In another session using the tail-20f command to view the output of the alarm log, the results found that the database has been waiting for a long time did not shut down properly, hang live in the following places:
Active call to process 11121 user ' Oracle ' program ' [email protected] (S000) '
Active call to process 7162 user ' Oracle ' program ' [email protected] (S011) '
As follows
The solution is to find the hang process and kill it (there is no operation, and no output information), because some sessions can not be cleaned by the Pmon process, resulting in the database can not be closed smoothly, need to manually kill the process. Use PS and grep first to find these two processes.
[Email protected] bdump]$ Ps-ef | grep Oracle | grep S000
[Email protected] bdump]$ Ps-ef | grep Oracle | grep S011
Then use the kill-9 Processesid kill the two processes can, kill the two processes, from the alarm log inside see jump to close dispatcher. As shown below:
1: [[email protected] 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
: Current log# 3 seq# 242223 mem# 0:/u01/app/oracle/oradata/epps/redo03_1.log
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)
: Current log# 5 seq# 242224 mem# 0:/u01/app/oracle/oradata/epps/redo05_1.log
: 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)
: Current log# 2 seq# 242225 mem# 0:/u01/app/oracle/oradata/epps/redo02_1.log
£ º 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 ten 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 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 to process 11121 user ' Oracle ' program ' [email protected] (S000) '
56:active call to process 7162 user ' Oracle ' program ' [email protected] (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's official documentation, explained below
The database is waiting-pmon to clean up processes, but Pmon is unable to
Clean them. The client connections to the server is 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 is we talking about?
1) Any non committed transactions must is 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 is cleaned up
Often Oracle (Smon or Pmon depending on whether Shared Server is used) would wait for the OS to terminate the process (es) a Ssociated with the session. If The OS never returns, or fails to terminate them, then the instance shutdown would hang with this message (Shutdown Wait ing for Active Calls to complete)
Other means exist to achieve a quick shutdown, as outlined in Note 386408.1 -What's the fastest-cleanly Shutdown an Oracle Database?
The result solves the above problem, thought can close the database smoothly, the result again hang, the alarm log information prompts for
Shutdown:active processes Prevent SHUTDOWN operation
The cause of this error occurs:
Because I probably have the following actions to cause:
[Email protected] scripts]$ Sqlplus/as SYSDBA
...........
Sql>!
[Email protected] ~]$
..... (Some shell commands were executed)
Then using the sqlplus started logging into the database, and then do shutdown immediate operation, which led to shutdown immediate be hang.
[Email protected] scripts]$ Sqlplus/as SYSDBA
workaround : Exit the current session, return to the original session, and reconnect, you can shut down the database properly
Resources:
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 database shutdown Immediate is stuck for several reasons