Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2796226
  • 博文数量: 389
  • 博客积分: 4177
  • 博客等级: 上校
  • 技术积分: 4773
  • 用 户 组: 普通用户
  • 注册时间: 2008-11-16 23:29
文章分类

全部博文(389)

分类: Oracle

2014-04-18 21:16:33

                              ORACLE RAC 11.2(12C)正确关闭顺序

       在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 (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

阅读(3430) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~