在11.2後的版本中crs被稱為gi,通過crsctl stop cluster來關閉整個執行個體的資源非常方便,但是對於資料庫執行個體需要單獨關閉,stop cluster對於執行個體直接以非正常的方式結束,環境是基於12C的。
正確的順序:
先關閉資料庫
[Oracle@rac1 ~]$ srvctl stop database -db tt
alert.log顯示是通過immediate方式關閉.
Sat Apr 19 05:12:19 2014
Shutting down instance (immediate)
Stopping background process SMCO
Shutting down instance: further logons disabled
Stopping background process CJQ0
Sat Apr 19 05:12:28 2014
Killed process oracle@rac1 (QM05) with pid is 58, OS pid 26310
Stopping background process MMNL
Stopping background process MMON
License high water mark = 8
All dispatchers and shared servers shutdown
ALTER DATABASE CLOSE NORMAL /* db agent *//* {1:28512:1593} */
Sat Apr 19 05:12:33 2014
SMON: disabling tx recovery
Sat Apr 19 05:12:33 2014
確認一下配置oracle執行個體是不是immediate方式來關閉的。
[oracle@rac1 ~]$ srvctl config database -db tt
Database unique name: tt
Database name: tt
Oracle home: /u01/app/oracle/product/12.1.0.0/db_1
Oracle user: oracle
Spfile: +DATA/tt/spfilett.ora
Password file: +DATA/tt/orapwtt
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: tt
Database instances: tt1,tt2
Disk Groups: DATA
Mount point paths:
Services:
Type: RAC
Start concurrency:
Stop concurrency:
Database is administrator managed
[oracle@rac1 ~]$
錯誤的方法:
為圖省事,直接關閉整個cluster
[root@rac1 ~]# crsctl stop cluster -all
CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac1'
CRS-2673: Attempting to stop 'ora.OCR1.dg' on 'rac1'
CRS-2673: Attempting to stop 'ora.tt.db' on 'rac1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac1'
CRS-2673: Attempting to stop 'ora.cvu' on 'rac1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.rac1.vip' on 'rac1'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac1'
CRS-2677: Stop of 'ora.cvu' on 'rac1' succeeded
CRS-2677: Stop of 'ora.tt.db' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac1'
CRS-2677: Stop of 'ora.rac1.vip' on 'rac1' succeeded
CRS-2677: Stop of 'ora.scan1.vip' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.crsd' on 'rac2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac2'
CRS-2673: Attempting to stop 'ora.tt.db' on 'rac2'
CRS-2673: Attempting to stop 'ora.OCR1.dg' on 'rac2'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac2'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.rac2.vip' on 'rac2'
CRS-2677: Stop of 'ora.rac2.vip' on 'rac2' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'rac1' succeeded
CRS-2677: Stop of 'ora.tt.db' on 'rac2' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac2'
CRS-2677: Stop of 'ora.DATA.dg' on 'rac2' succeeded
..............................
alert.log顯示執行個體是非常結束
License high water mark = 6
Sat Apr 19 05:15:14 2014
USER (ospid: 5792): terminating the instance
Sat Apr 19 05:15:14 2014
opiodr aborting process unknown ospid (3667) as a result of ORA-1092
Sat Apr 19 05:15:15 2014
Instance terminated by USER, pid = 5792
由此可以看出通過stop cluster來關閉執行個體會非常危險,直接是以非正常的方式來關閉執行個體的.
重啟執行個體可以看到恢複操作
Sat Apr 19 05:31:20 2014
Beginning crash recovery of 1 threads
parallel recovery started with 2 processes
Sat Apr 19 05:31:21 2014
Started redo scan
Sat Apr 19 05:31:21 2014
Completed redo scan
read 255 KB redo, 69 data blocks need recovery
Sat Apr 19 05:31:21 2014
Started redo application at
Thread 2: logseq 2, block 3004
Sat Apr 19 05:31:22 2014
Recovery of Online Redo Log: Thread 2 Group 4 Seq 2 Reading mem 0
Mem# 0: +DATA/tt/redo04.log
Sat Apr 19 05:31:22 2014
Completed redo application of 0.14MB
Sat Apr 19 05:31:22 2014
Completed crash recovery at
Thread 2: logseq 2, block 3514, scn 1969283
69 data blocks read, 69 data blocks written, 255 redo k-bytes read
推薦閱讀:
CentOS 6.3(x32)下安裝Oracle 10g R2
Linux-6-64下安裝Oracle 12C筆記