Oracle數(shù)據(jù)庫(kù)shutdown immediate被hang住的幾個(gè)原因
實(shí)驗(yàn)操作環(huán)境:
操作系統(tǒng):Red Hat Enterprise Linux ES release 4 (Nahant Update 6)
數(shù)據(jù)庫(kù) : Oracle Database 10g Release 10.2.0.4.0 – Production 32bit
今晚使用shutdown immediate(其實(shí)是執(zhí)行stop_oracle.sh腳本關(guān)閉數(shù)據(jù)庫(kù),如下所示)關(guān)閉數(shù)據(jù)庫(kù)的時(shí)候,
1: [oracle@gsp-orasvr02 scripts]$ more stop_oracle.sh
2: lsnrctl stop LISTENER
3: sleep 15
4: sqlplus /nolog < 在另外一個(gè)會(huì)話中使用tail -20f 命令查看告警日志的輸出,結(jié)果發(fā)現(xiàn)數(shù)據(jù)庫(kù)等待了很長(zhǎng)時(shí)間都沒(méi)有正常關(guān)閉,,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)' 截圖如下 這時(shí)解決辦法是找出hang住的進(jìn)程并殺掉(當(dāng)時(shí)操作沒(méi)有截圖,也沒(méi)有保存輸出信息),因?yàn)橛行﹕ession無(wú)法被pmon進(jìn)程清理,導(dǎo)致數(shù)據(jù)庫(kù)無(wú)法順利關(guān)閉,需要手工殺掉進(jìn)程。首先使用ps 和grep找到這兩個(gè)進(jìn)程。 [ oracle@get-orasvr02 bdump]$ ps -ef | grep oracle | grep S000 [ oracle@get-orasvr02 bdump]$ ps -ef | grep oracle | grep S011 然后使用kill -9 processesid殺掉這兩個(gè)進(jìn)程即可,殺掉這兩個(gè)進(jìn)程后,從告警日志里面看到里面跳到關(guān)閉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
聲明:本網(wǎng)頁(yè)內(nèi)容旨在傳播知識(shí),若有侵權(quán)等問(wèn)題請(qǐng)及時(shí)與本網(wǎng)聯(lián)系,我們將在第一時(shí)間刪除處理。TEL:177 7030 7066 E-MAIL:11247931@qq.com