月度归档:2013年12月

0racle 11.2.0.3 RAC在线迁移OCR&VOTE ASM磁盘组

最近一个土豪客户要更换存储(原存储IBM DS8300,新存储EMC VMAX 20K,这都是高端存储),因此涉及到系统和数据库的迁移,这个项目很大,据说三年前就已经开始策划。其中要迁移的核心数据库是一套DB2,数据量达30T+,还有一套11.2.0.2 Oracle RAC,数据量500G+,DB2迁移暂先不说,因为不是专门搞那个的。由于要负责这套Oracle RAC的迁移,采用的迁移方案是,先将OCR&VOTE ASM磁盘组在线从原存储IBM DS8300迁移到新存储EMC VMAX 20K的ASM磁盘组上,然后将集群全部关闭,通过存储间的拷贝方式将原IBM DS8300存储上的DATA和ARCH ASM磁盘组中的数据拷贝到新存储EMC VMAX 20K上,拷贝完成后,扫描磁盘然后启动集群。这里我们不讨论这个迁移方案是否合理,因为这其中夹杂着很多政治因素,我们只关心迁移方案中的第一步,即OCR&VOTE ASM磁盘组在线迁移问题。其实,这里我们并不用非常关心OCR&VOTE ASM磁盘组到底是从IBM DS8300迁移到EMC VMAX 20K上还是从EMC VMAX 20K迁移到IBM DS8300上,因为从本质上讲只是将OCR&VOTE换一个位置而已。下面是我在自己虚拟机上进行的一个测试,特记录一下,留作备用。

一、测试环境

----软件版本
Oracle VirtualBox 4.3 + Oracle Linux 5.8 + UDEV + 11.2.0.3 Grid + 11.2.0.3 DB

----IP地址
# cat /etc/hosts
# Do not remove the following line, or various programs
# that require network functionality will fail.
127.0.0.1               localhost.localdomain localhost
::1             localhost6.localdomain6 localhost6
# Public IP
192.168.56.111 11grac1.localdomain 11grac1
192.168.56.112 11grac2.localdomain 11grac2
# Private IP
192.168.10.1 11grac1-priv.localdomain 11grac1-priv
192.168.10.2 11grac2-priv.localdomain 11grac2-priv
# Virtual IP
192.168.56.113 11grac1-vip.localdomain 11grac1-vip
192.168.56.114 11grac2-vip.localdomain 11grac2-vip
# SCAN IP
192.168.56.115 SCAN

----共享存储磁盘
# ls -l /dev/sd*
brw-rw---- 1 root root 8, 16 Dec 25  2013 sdb
brw-rw---- 1 root root 8, 32 Dec 25  2013 sdc
brw-rw---- 1 root root 8, 48 Dec 25  2013 sdd

----UDEV绑定ASM磁盘
# ls -l /dev/asm*
brw-rw---- 1 grid asmadmin 8, 16 Dec 25 05:22 /dev/asm-diskb
brw-rw---- 1 grid asmadmin 8, 32 Dec 25 03:45 /dev/asm-diskc
brw-rw---- 1 grid asmadmin 8, 48 Dec 25 05:22 /dev/asm-diskd

----ASM实例
SQL> select instance_name,status from gv$instance;
  
INSTANCE_NAME    STATUS
---------------- ------------
+ASM1            STARTED
+ASM2            STARTED

----ASM实例spfile
SYS@+ASM1> show parameter spfile;
  
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +OCRVOTE/rac11g-cluster/asmpar
                                                 ameterfile/registry.253.835086289
SYS@+ASM2> show parameter spfile;
  
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +OCRVOTE/rac11g-cluster/asmpar
                                                 ameterfile/registry.253.835086289

----ASM DISKGROUP
SYS@+ASM1> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME            STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ --------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA            MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           3 OCRVOTE         MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
SYS@+ASM2> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME            STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ --------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA            MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           3 OCRVOTE         MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0

----ASM DISK
SYS@+ASM1> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME            PATH            FAILGROUP
------------ ----------- -------- ------- ---------- ---------- --------------- --------------- ----------------
           0           0 NORMAL   UNKNOWN          0          0                 /dev/asm-diskd
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000       /dev/asm-diskc  DATA_0000
           3           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_0000    /dev/asm-diskb  OCRVOTE_0000
SYS@+ASM2> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;  
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME              PATH            FAILGROUP
------------ ----------- -------- ------- ---------- ---------- --------------- --------------- -----------------
           0           0 NORMAL   UNKNOWN          0          0                 /dev/asm-diskd
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000       /dev/asm-diskc  DATA_0000
           3           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_0000    /dev/asm-diskb  OCRVOTE_0000

----DB实例
SQL> select instance_name,status from gv$instance;
  
INSTANCE_NAME    STATUS
---------------- ------------
RAC11g2          OPEN
RAC11g1          OPEN

----DB实例spfile
SQL> show parameter spfile;
  
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +DATA/rac11g/spfilerac11g.ora

---OCR&VOTE信息
[root@11grac1 ~]# ocrcheck && crsctl query css votedisk
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2960
         Available space (kbytes) :     259160
         ID                       :  331841301
         Device/File Name         :   +OCRVOTE
                                    Device/File integrity check succeeded
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
         Cluster registry integrity check succeeded
  
         Logical corruption check succeeded
  
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   5cc943d1e0544f49bf7a1f698de670c9 (/dev/asm-diskb) [OCRVOTE]
Located 1 voting disk(s).
[root@11grac2 ~]# ocrcheck && crsctl query css votedisk
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2960
         Available space (kbytes) :     259160
         ID                       :  331841301
         Device/File Name         :   +OCRVOTE
                                    Device/File integrity check succeeded
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
         Cluster registry integrity check succeeded
  
         Logical corruption check succeeded
  
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   5cc943d1e0544f49bf7a1f698de670c9 (/dev/asm-diskb) [OCRVOTE]
Located 1 voting disk(s).

二、测试目标
目前该RAC的OCR&VOTE存放在OCRVOTE ASM磁盘组,准备在线迁移到OCRVOTE_NEW ASM磁盘组上。 三、详细过程

1.查看OCR和VOTE状态与位置(在两个节点root执行)
[root@11grac1 ~]# ocrcheck && crsctl query css votedisk
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2960
         Available space (kbytes) :     259160
         ID                       :  331841301
         Device/File Name         :   +OCRVOTE
                                    Device/File integrity check succeeded
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
         Cluster registry integrity check succeeded
  
         Logical corruption check succeeded
  
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   5cc943d1e0544f49bf7a1f698de670c9 (/dev/asm-diskb) [OCRVOTE]
[root@11grac2 ~]# ocrcheck && crsctl query css votedisk
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2960
         Available space (kbytes) :     259160
         ID                       :  331841301
         Device/File Name         :   +OCRVOTE
                                    Device/File integrity check succeeded
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
         Cluster registry integrity check succeeded
  
         Logical corruption check succeeded
  
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   5cc943d1e0544f49bf7a1f698de670c9 (/dev/asm-diskb) [OCRVOTE]
Located 1 voting disk(s).

2.在两节点查看OCR备份情况(在两节点root执行)
[root@11grac1 ~]# ocrconfig -showbackup 
11grac2     2013/12/25 07:46:20     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/backup00.ocr 
11grac2     2013/12/25 07:46:20     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/day.ocr 
11grac2     2013/12/25 07:46:20     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/week.ocr 
11grac2     2013/12/24 20:54:01     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/backup_20131224_205401.ocr 
11grac2     2013/12/24 20:53:22     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/backup_20131224_205322.ocr 
11grac1     2013/12/24 20:21:31     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/backup_20131224_202131.ocr 
11grac1     2013/12/24 20:16:55     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/backup_20131224_201655.ocr 
11grac1     2013/12/24 18:09:31     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/backup_20131224_180931.ocr
[root@11grac2 ~]# ocrconfig -showbackup  
11grac2     2013/12/25 07:46:20     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/backup00.ocr  
11grac2     2013/12/25 07:46:20     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/day.ocr  
11grac2     2013/12/25 07:46:20     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/week.ocr 
11grac2     2013/12/24 20:54:01     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/backup_20131224_205401.ocr  
11grac2     2013/12/24 20:53:22     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/backup_20131224_205322.ocr  
11grac1     2013/12/24 20:21:31     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/backup_20131224_202131.ocr  
11grac1     2013/12/24 20:16:55     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/backup_20131224_201655.ocr  
11grac1     2013/12/24 18:09:31     /grid/product/11.2.0/grid_1/cdata/rac11g-cluster/backup_20131224_180931.ocr

3.手动执行物理备份---可选操作(在一个节点或两个节点root执行)
# ocrconfig -manualbackup

4.再次查看OCR备份情况---可选操作(在两个节点root执行)
# ocrconfig -showbackup

5.创建将要迁移OCR&VOTE到新的ASM磁盘组OCRVOTE_NEW(在一个节点grid用户登录ASM实例执行)
SYS@+ASM1> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME            PATH            FAILGROUP
------------ ----------- -------- ------- ---------- ---------- --------------- --------------- ----------------
           0           0 NORMAL   UNKNOWN          0          0                 /dev/asm-diskd
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000       /dev/asm-diskc  DATA_0000
           3           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_0000    /dev/asm-diskb  OCRVOTE_0000
  
SYS@+ASM1> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME            STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ --------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA            MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           3 OCRVOTE         MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
  
SYS@+ASM2> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME              PATH            FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ----------------- --------------- -----------------
           0           0 NORMAL   UNKNOWN          0          0                   /dev/asm-diskd
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000         /dev/asm-diskc  DATA_0000
           3           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_0000      /dev/asm-diskb  OCRVOTE_0000
  
SYS@+ASM2> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME              STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ----------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA              MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           3 OCRVOTE           MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
  
SYS@+ASM1> create diskgroup OCRVOTE_NEW EXTERNAL REDUNDANCY DISK '/dev/asm-diskd' attribute 'compatible.asm'='11.2';
  
Diskgroup created.
----创建OCRVOTE_NEW ASM磁盘组的节点ASM实例会自动mount该磁盘组,但是另一个节点不会mount上该磁盘组

6.查看新创建的ASM磁盘组(在两个节点grid用户登录ASM实例执行)
SYS@+ASM1> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME            STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ --------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA            MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           3 OCRVOTE         MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
           2 OCRVOTE_NEW     MOUNTED     EXTERN       2048       1996 N 11.2.0.0.0
  
SYS@+ASM1> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME               PATH            FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ------------------ --------------- ----------------
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000          /dev/asm-diskc  DATA_0000
           2           0 NORMAL   UNKNOWN       2048       1996 OCRVOTE_NEW_0000   /dev/asm-diskd  OCRVOTE_NEW_0000
           3           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_0000       /dev/asm-diskb  OCRVOTE_0000
  
SYS@+ASM2> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME              STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ----------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA              MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           0 OCRVOTE_NEW       DISMOUNTED                  0          0 N 0.0.0.0.0
           3 OCRVOTE           MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
  
SYS@+ASM2> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME              PATH            FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ----------------- --------------- -----------------
           0           0 NORMAL   UNKNOWN          0          0                   /dev/asm-diskd
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000         /dev/asm-diskc  DATA_0000
           3           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_0000      /dev/asm-diskb  OCRVOTE_0000
----节点2 ASM实例没有mount上OCRVOTE_NEW磁盘组

7.挂载新创建的ASM磁盘组(在在没有mount上新创建的ASM磁盘组节点上以grid用户登录ASM实例执行)
SYS@+ASM2> alter diskgroup OCRVOTE_NEW mount;
  
Diskgroup altered.
  
SYS@+ASM2> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME              PATH            FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ----------------- --------------- -----------------
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000         /dev/asm-diskc  DATA_0000
           2           0 NORMAL   UNKNOWN       2048       1953 OCRVOTE_NEW_0000  /dev/asm-diskd  OCRVOTE_NEW_0000
           3           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_0000      /dev/asm-diskb  OCRVOTE_0000
  
SYS@+ASM2> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME              STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ----------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA              MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           2 OCRVOTE_NEW       MOUNTED     EXTERN       2048       1953 N 11.2.0.0.0
           3 OCRVOTE           MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0

8.将新创建的ASM磁盘组OCRVOTE_NEW添加到OCR中(在一个节点root执行)
[root@11grac1 ~]# ocrconfig -add +OCRVOTE_NEW

9.查看OCR和VOTE状态与位置(在两个节点root执行)
[root@11grac1 ~]# ocrcheck && crsctl query css votedisk
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2976
         Available space (kbytes) :     259144
         ID                       :  331841301
         Device/File Name         :   +OCRVOTE
                                    Device/File integrity check succeeded
         Device/File Name         : +OCRVOTE_NEW
                                    Device/File integrity check succeeded
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
         Cluster registry integrity check succeeded
  
         Logical corruption check succeeded
  
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   5cc943d1e0544f49bf7a1f698de670c9 (/dev/asm-diskb) [OCRVOTE]
Located 1 voting disk(s).
[root@11grac2 ~]# ocrcheck && crsctl query css votedisk
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2976
         Available space (kbytes) :     259144
         ID                       :  331841301
         Device/File Name         :   +OCRVOTE
                                    Device/File integrity check succeeded
         Device/File Name         : +OCRVOTE_NEW
                                    Device/File integrity check succeeded
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
         Cluster registry integrity check succeeded
  
         Logical corruption check succeeded
  
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   5cc943d1e0544f49bf7a1f698de670c9 (/dev/asm-diskb) [OCRVOTE]
Located 1 voting disk(s).

SYS@+ASM1> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME             STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ---------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA             MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           2 OCRVOTE_NEW      MOUNTED     EXTERN       2048       1685 N 11.2.0.0.0
           3 OCRVOTE          MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
  
SYS@+ASM1> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME             PATH             FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ---------------- ---------------- ----------------
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000        /dev/asm-diskc   DATA_0000
           2           0 NORMAL   UNKNOWN       2048       1685 OCRVOTE_NEW_0000 /dev/asm-diskd   OCRVOTE_NEW_0000
           3           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_0000     /dev/asm-diskb   OCRVOTE_0000
  
SYS@+ASM2> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME             STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ---------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA             MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           2 OCRVOTE_NEW      MOUNTED     EXTERN       2048       1685 N 11.2.0.0.0
           3 OCRVOTE          MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
  
SYS@+ASM2> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME             PATH             FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ---------------- ---------------- ----------------
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000        /dev/asm-diskc   DATA_0000
           2           0 NORMAL   UNKNOWN       2048       1685 OCRVOTE_NEW_0000 /dev/asm-diskd   OCRVOTE_NEW_0000
           3           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_0000     /dev/asm-diskb   OCRVOTE_0000
----此时会看见OCR的位置出现在两处,其中+OCRVOTE_NEW为OCR的mirror

10.迁移VOTE DISK到新创建的ASM磁盘组OCRVOTE_NEW上(在一个节点root执行)
[root@11grac1 ~]# crsctl replace votedisk +OCRVOTE_NEW
Successful addition of voting disk 1bd1f2b28abc4ff6bf1a4113f2ce1067.
Successful deletion of voting disk 5cc943d1e0544f49bf7a1f698de670c9.
Successfully replaced voting disk group with +OCRVOTE_NEW.
CRS-4266: Voting file(s) successfully replaced

11.查看此时OCR&VOTE ASM磁盘组状态(在两个节点grid用户登录ASM实例执行)
SYS@+ASM1> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME               STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ------------------ ----------- ------ ---------- ---------- - ---------------
           1 DATA               MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           3 OCRVOTE            MOUNTED     EXTERN       2048       1684 N 11.2.0.0.0
           2 OCRVOTE_NEW        MOUNTED     EXTERN       2048       1653 Y 11.2.0.0.0
----可以看见执行crsctl replace votedisk +OCRVOTE_NEW操作的节点上v$asm_diskgroup中已显示将voting file存放在新建的ASM磁盘组OCRVOTE_NEW上
----这里其实存在疑问,我测试过几次,得出的结果不同,1节点执行完crsctl replace votedisk +OCRVOTE_NEW操作后,v$asm_diskgroup中也会显示voting file同时存放在ASM磁盘组OCRVOTE和OCRVOTE_NEW上
SYS@+ASM2> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME              STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ----------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA              MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           2 OCRVOTE_NEW       MOUNTED     EXTERN       2048       1653 N 11.2.0.0.0
           3 OCRVOTE           MOUNTED     EXTERN       2048       1684 Y 11.2.0.0.0
----未执行crsctl replace votedisk +OCRVOTE_NEW操作的节点上v$asm_diskgroup中显示voting file仍然存放在ASM磁盘组上
----这里其实也存在疑问,我测试过几次,得出的结果不同,未执行crsctl replace votedisk +OCRVOTE_NEW操作的节点上v$asm_diskgroup中显示voting file既没有存放在OCRVOTE上,也没有存放在OCRVOTE_NEW上

12.查看OCR和VOTE状态与位置(在两个节点root执行)
[root@11grac1 ~]# ocrcheck && crsctl query css votedisk
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2976
         Available space (kbytes) :     259144
         ID                       :  331841301
         Device/File Name         :   +OCRVOTE
                                    Device/File integrity check succeeded
         Device/File Name         : +OCRVOTE_NEW
                                    Device/File integrity check succeeded
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
         Cluster registry integrity check succeeded
  
         Logical corruption check succeeded
  
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   1bd1f2b28abc4ff6bf1a4113f2ce1067 (/dev/asm-diskd) [OCRVOTE_NEW]
[root@11grac2 ~]# ocrcheck && crsctl query css votedisk
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2976
         Available space (kbytes) :     259144
         ID                       :  331841301
         Device/File Name         :   +OCRVOTE
                                    Device/File integrity check succeeded
         Device/File Name         : +OCRVOTE_NEW
                                    Device/File integrity check succeeded
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
         Cluster registry integrity check succeeded
  
         Logical corruption check succeeded
  
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   1bd1f2b28abc4ff6bf1a4113f2ce1067 (/dev/asm-diskd) [OCRVOTE_NEW]
Located 1 voting disk(s).

13.创建ASM实例spfile到新创建的OCRVOTE_NEW ASM磁盘组上(在一个节点grid用户登录ASM实例执行)
SYS@+ASM1> create pfile='/home/grid/asmpfile.ora' from spfile;
  
File created.
  
SYS@+ASM1> create spfile='+OCRVOTE_NEW' from pfile='/home/grid/asmpfile.ora';
  
File created.

14.删除OCR原位置ASM磁盘组OCRVOTE(在一个节点root执行)
[root@11grac1 ~]# ocrconfig -delete +OCRVOTE

15.查看OCR和VOTE新状态与位置(在两个节点root执行)
[root@11grac1 ~]# ocrcheck && crsctl query css votedisk
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2976
         Available space (kbytes) :     259144
         ID                       :  331841301
         Device/File Name         : +OCRVOTE_NEW
                                    Device/File integrity check succeeded
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
         Cluster registry integrity check succeeded
  
         Logical corruption check succeeded
  
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   1bd1f2b28abc4ff6bf1a4113f2ce1067 (/dev/asm-diskd) [OCRVOTE_NEW]
Located 1 voting disk(s).
[root@11grac2 ~]# ocrcheck && crsctl query css votedisk
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2976
         Available space (kbytes) :     259144
         ID                       :  331841301
         Device/File Name         : +OCRVOTE_NEW
                                    Device/File integrity check succeeded
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
         Cluster registry integrity check succeeded
  
         Logical corruption check succeeded
  
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   1bd1f2b28abc4ff6bf1a4113f2ce1067 (/dev/asm-diskd) [OCRVOTE_NEW]
Located 1 voting disk(s).

SYS@+ASM1> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME             STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ---------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA             MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           2 OCRVOTE_NEW      MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
           3 OCRVOTE          MOUNTED     EXTERN       2048       1684 N 11.2.0.0.0
  
SYS@+ASM1> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME             PATH             FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ---------------- ---------------- ----------------
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000        /dev/asm-diskc   DATA_0000
           2           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_NEW_0000 /dev/asm-diskd   OCRVOTE_NEW_0000
           3           0 NORMAL   UNKNOWN       2048       1684 OCRVOTE_0000     /dev/asm-diskb   OCRVOTE_0000
  
SYS@+ASM2> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME             STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ---------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA             MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           2 OCRVOTE_NEW      MOUNTED     EXTERN       2048       1652 N 11.2.0.0.0
           3 OCRVOTE          MOUNTED     EXTERN       2048       1684 Y 11.2.0.0.0
  
SYS@+ASM2> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME             PATH             FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ---------------- ---------------- ----------------
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000        /dev/asm-diskc   DATA_0000
           2           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_NEW_0000 /dev/asm-diskd   OCRVOTE_NEW_0000
           3           0 NORMAL   UNKNOWN       2048       1684 OCRVOTE_0000     /dev/asm-diskb   OCRVOTE_0000

16.重启集群(在两个节点root执行)
[root@11grac1 ~]# crsctl stop crs && crsctl start crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on '11grac1'
CRS-2673: Attempting to stop 'ora.crsd' on '11grac1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on '11grac1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on '11grac1'
CRS-2673: Attempting to stop 'ora.cvu' on '11grac1'
CRS-2673: Attempting to stop 'ora.oc4j' on '11grac1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on '11grac1'
CRS-2673: Attempting to stop 'ora.OCRVOTE.dg' on '11grac1'
CRS-2673: Attempting to stop 'ora.OCRVOTE_NEW.dg' on '11grac1'
CRS-2673: Attempting to stop 'ora.rac11g.db' on '11grac1'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on '11grac1' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on '11grac1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on '11grac1' succeeded
CRS-2673: Attempting to stop 'ora.11grac1.vip' on '11grac1'
CRS-2677: Stop of 'ora.scan1.vip' on '11grac1' succeeded
CRS-2672: Attempting to start 'ora.scan1.vip' on '11grac2'
CRS-2677: Stop of 'ora.11grac1.vip' on '11grac1' succeeded
CRS-2672: Attempting to start 'ora.11grac1.vip' on '11grac2'
CRS-2676: Start of 'ora.scan1.vip' on '11grac2' succeeded
CRS-2676: Start of 'ora.11grac1.vip' on '11grac2' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on '11grac2'
CRS-2677: Stop of 'ora.cvu' on '11grac1' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on '11grac2' succeeded
CRS-2677: Stop of 'ora.rac11g.db' on '11grac1' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on '11grac1'
CRS-2677: Stop of 'ora.DATA.dg' on '11grac1' succeeded
CRS-2677: Stop of 'ora.oc4j' on '11grac1' succeeded
CRS-2677: Stop of 'ora.OCRVOTE.dg' on '11grac1' succeeded
CRS-2677: Stop of 'ora.OCRVOTE_NEW.dg' on '11grac1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on '11grac1'
CRS-2677: Stop of 'ora.asm' on '11grac1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on '11grac1'
CRS-2677: Stop of 'ora.ons' on '11grac1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on '11grac1'
CRS-2677: Stop of 'ora.net1.network' on '11grac1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on '11grac1' has completed
CRS-2677: Stop of 'ora.crsd' on '11grac1' succeeded
CRS-2673: Attempting to stop 'ora.crf' on '11grac1'
CRS-2673: Attempting to stop 'ora.ctssd' on '11grac1'
CRS-2673: Attempting to stop 'ora.evmd' on '11grac1'
CRS-2673: Attempting to stop 'ora.asm' on '11grac1'
CRS-2673: Attempting to stop 'ora.mdnsd' on '11grac1'
CRS-2677: Stop of 'ora.crf' on '11grac1' succeeded
CRS-2677: Stop of 'ora.evmd' on '11grac1' succeeded
CRS-2677: Stop of 'ora.ctssd' on '11grac1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on '11grac1' succeeded
CRS-2677: Stop of 'ora.asm' on '11grac1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on '11grac1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on '11grac1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on '11grac1'
CRS-2677: Stop of 'ora.cssd' on '11grac1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on '11grac1'
CRS-2677: Stop of 'ora.gipcd' on '11grac1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on '11grac1'
CRS-2677: Stop of 'ora.gpnpd' on '11grac1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on '11grac1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.
[root@11grac2 ~]# crsctl stop crs && crsctl start crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on '11grac2'
CRS-2673: Attempting to stop 'ora.crsd' on '11grac2'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on '11grac2'
CRS-2673: Attempting to stop 'ora.11grac2.vip' on '11grac2'
CRS-2673: Attempting to stop 'ora.OCRVOTE.dg' on '11grac2'
CRS-2673: Attempting to stop 'ora.OCRVOTE_NEW.dg' on '11grac2'
CRS-2673: Attempting to stop 'ora.rac11g.db' on '11grac2'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on '11grac2'
CRS-2677: Stop of 'ora.11grac2.vip' on '11grac2' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.11grac1.vip' on '11grac2'
CRS-2677: Stop of 'ora.11grac1.vip' on '11grac2' succeeded
CRS-2677: Stop of 'ora.rac11g.db' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg' on '11grac2'
CRS-2677: Stop of 'ora.DATA.dg' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on '11grac2'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on '11grac2'
CRS-2677: Stop of 'ora.scan1.vip' on '11grac2' succeeded
CRS-2677: Stop of 'ora.OCRVOTE.dg' on '11grac2' succeeded
CRS-2677: Stop of 'ora.OCRVOTE_NEW.dg' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.asm' on '11grac2'
CRS-2677: Stop of 'ora.asm' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.ons' on '11grac2'
CRS-2677: Stop of 'ora.ons' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on '11grac2'
CRS-2677: Stop of 'ora.net1.network' on '11grac2' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on '11grac2' has completed
CRS-2677: Stop of 'ora.crsd' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.crf' on '11grac2'
CRS-2673: Attempting to stop 'ora.ctssd' on '11grac2'
CRS-2673: Attempting to stop 'ora.evmd' on '11grac2'
CRS-2673: Attempting to stop 'ora.asm' on '11grac2'
CRS-2673: Attempting to stop 'ora.mdnsd' on '11grac2'
CRS-2677: Stop of 'ora.crf' on '11grac2' succeeded
CRS-2677: Stop of 'ora.mdnsd' on '11grac2' succeeded
CRS-2677: Stop of 'ora.evmd' on '11grac2' succeeded
CRS-2677: Stop of 'ora.ctssd' on '11grac2' succeeded
CRS-2677: Stop of 'ora.asm' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on '11grac2'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on '11grac2'
CRS-2677: Stop of 'ora.cssd' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on '11grac2'
CRS-2677: Stop of 'ora.gipcd' on '11grac2' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on '11grac2'
CRS-2677: Stop of 'ora.gpnpd' on '11grac2' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on '11grac2' has completed
CRS-4133: Oracle High Availability Services has been stopped.
CRS-4123: Oracle High Availability Services has been started.

17.查看OCR&VOTE位置及ASM实例spfile位置(在两个节点grid用户登录ASM实例执行)
[root@11grac1 ~]# ocrcheck && crsctl query css votedisk
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2976
         Available space (kbytes) :     259144
         ID                       :  331841301
         Device/File Name         : +OCRVOTE_NEW
                                    Device/File integrity check succeeded
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
         Cluster registry integrity check succeeded
  
         Logical corruption check succeeded
  
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   943d41e7dd624fd9bf8becbf18b434f5 (/dev/asm-diskd) [OCRVOTE_NEW]
Located 1 voting disk(s).
[root@11grac2 ~]# ocrcheck && crsctl query css votedisk
Status of Oracle Cluster Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2976
         Available space (kbytes) :     259144
         ID                       :  331841301
         Device/File Name         : +OCRVOTE_NEW
                                    Device/File integrity check succeeded
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
                                    Device/File not configured
  
         Cluster registry integrity check succeeded
  
         Logical corruption check succeeded
  
##  STATE    File Universal Id                File Name Disk group
--  -----    -----------------                --------- ---------
 1. ONLINE   943d41e7dd624fd9bf8becbf18b434f5 (/dev/asm-diskd) [OCRVOTE_NEW]
Located 1 voting disk(s).

SYS@+ASM1> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME             STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ---------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA             MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           2 OCRVOTE_NEW      MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
           3 OCRVOTE          MOUNTED     EXTERN       2048       1684 N 11.2.0.0.0
  
SYS@+ASM1> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME             PATH             FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ---------------- ---------------- ----------------
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000        /dev/asm-diskc   DATA_0000
           2           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_NEW_0000 /dev/asm-diskd   OCRVOTE_NEW_0000
           3           0 NORMAL   UNKNOWN       2048       1684 OCRVOTE_0000     /dev/asm-diskb   OCRVOTE_0000
  
SYS@+ASM2> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME             STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ---------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA             MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           2 OCRVOTE_NEW      MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
           3 OCRVOTE          MOUNTED     EXTERN       2048       1684 N 11.2.0.0.0
  
SYS@+ASM2> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME             PATH             FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ---------------- ---------------- ----------------
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000        /dev/asm-diskc   DATA_0000
           2           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_NEW_0000 /dev/asm-diskd   OCRVOTE_NEW_0000
           3           0 NORMAL   UNKNOWN       2048       1684 OCRVOTE_0000     /dev/asm-diskb   OCRVOTE_0000           
  
SYS@+ASM1> show parameter spfile;
  
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +OCRVOTE_NEW/rac11g-cluster/as
                                                 mparameterfile/registry.253.83
                                                 5094929
  
SYS@+ASM2> show parameter spfile;
  
NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
spfile                               string      +OCRVOTE_NEW/rac11g-cluster/as
                                                 mparameterfile/registry.253.83
                                                 5094929

18.将OCR原位置ASM磁盘组OCRVOTE卸载掉(在一个节点grid用户登录ASM实例执行)
SYS@+ASM1> alter diskgroup OCRVOTE dismount;
  
Diskgroup altered.
  
SYS@+ASM1> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME             STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ---------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA             MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           2 OCRVOTE_NEW      MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
           0 OCRVOTE          DISMOUNTED                  0          0 N 0.0.0.0.0
  
SYS@+ASM1> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME             PATH             FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ---------------- ---------------- ----------------
           0           0 NORMAL   UNKNOWN          0          0                  /dev/asm-diskb
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000        /dev/asm-diskc   DATA_0000
           2           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_NEW_0000 /dev/asm-diskd   OCRVOTE_NEW_0000
  
SYS@+ASM2> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME             STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ---------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA             MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           2 OCRVOTE_NEW      MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
           3 OCRVOTE          MOUNTED     EXTERN       2048       1684 N 11.2.0.0.0
  
SYS@+ASM2> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME             PATH             FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ---------------- ---------------- ----------------
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000        /dev/asm-diskc   DATA_0000
           2           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_NEW_0000 /dev/asm-diskd   OCRVOTE_NEW_0000
           3           0 NORMAL   UNKNOWN       2048       1684 OCRVOTE_0000     /dev/asm-diskb   OCRVOTE_0000

19.删除OCR原位置ASM磁盘组OCRVOTE(在另一个节点grid用户登录ASM实例执行)
SYS@+ASM2> drop diskgroup OCRVOTE including contents;
  
Diskgroup dropped.
  
SYS@+ASM1> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME             STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ---------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA             MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           2 OCRVOTE_NEW      MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
  
SYS@+ASM1> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME             PATH             FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ---------------- ---------------- ----------------
           0           0 NORMAL   UNKNOWN          0          0                  /dev/asm-diskb
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000        /dev/asm-diskc   DATA_0000
           2           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_NEW_0000 /dev/asm-diskd   OCRVOTE_NEW_0000
  
SYS@+ASM2> select GROUP_NUMBER,NAME,STATE,type,TOTAL_MB,free_mb,VOTING_FILES,COMPATIBILITY from v$asm_diskgroup;
  
GROUP_NUMBER NAME             STATE       TYPE     TOTAL_MB    FREE_MB V COMPATIBILITY
------------ ---------------- ----------- ------ ---------- ---------- - ---------------
           1 DATA             MOUNTED     EXTERN       5120       2792 N 11.2.0.0.0
           2 OCRVOTE_NEW      MOUNTED     EXTERN       2048       1652 Y 11.2.0.0.0
  
SYS@+ASM2> select GROUP_NUMBER,DISK_NUMBER,STATE,REDUNDANCY,TOTAL_MB,FREE_MB,name,path,failgroup from v$asm_disk order by GROUP_NUMBER;
  
GROUP_NUMBER DISK_NUMBER STATE    REDUNDA   TOTAL_MB    FREE_MB NAME             PATH             FAILGROUP
------------ ----------- -------- ------- ---------- ---------- ---------------- ---------------- ----------------
           0           0 NORMAL   UNKNOWN          0          0                  /dev/asm-diskb
           1           0 NORMAL   UNKNOWN       5120       2792 DATA_0000        /dev/asm-diskc   DATA_0000
           2           0 NORMAL   UNKNOWN       2048       1652 OCRVOTE_NEW_0000 /dev/asm-diskd   OCRVOTE_NEW_0000 
----这里不执行19步无法删除该磁盘组

20.整个迁移过程结束

以上为Oracle 11gR2在线迁移OCR&VOTE ASM磁盘组过程,其中不涉及存储中所使用多路径软件问题,如果涉及到存储磁盘路径改变,则需要去修改ASM实例的disk_strings参数,具体操作可以参考Maclea的这篇博客在11gR2 RAC中修改ASM DISK Path磁盘路径,论坛贴链接[讨论]11G RAC更换存储,如有问题,欢迎讨论。

检点这一年工作的点点滴滴

就在刚才又拒绝了一个offer,这事说起来真觉得很对不起人家,因为这已是第二次拒绝人家的入职邀请,最重要的是第二次谈工作是我主动联系人家的,因为我担心之前已经拒绝过人家的offer,再去投可能性太小,然后主动联系HR说明情况,结果人家还是给我了第二次机会,最后也被录用,但是我再次拒绝了这次机会。

到此你可能觉得我太不厚道了,其实我也觉得有点,如果换个角度站在对方的立场,即便是我自己也无法接受这种样的行为,但是我们决定是否选择或接受一份工作,都有自己的标准和原则。我个人觉得,如果仅因为别人提供给你两次甚至更多次的工作机会(感动或是感恩)而接受一家可能并不是真正适合自己发展(公司文化或是发展方向定位)又或是薪资达不到自己期望值的公司(这里暂先不谈是否有一个好的领导),最后可能苦的还是自己。为什么这么说,原因很简单,如果你拿不到自己期望的薪资,你甚至都不会考虑,这样说起来可能会很俗,但是这绝对是一个很重要的原因。试想一种情况,你期望的薪资8k,如果用人单位给你7.5K,可能你会妥协,但如果给你6.5K,你可能不会再考虑,因为薪资已经低于你能接受的底线。如果用人单位给你的薪资达到了你的期望值,但是如果公司的内部文化或工作氛围不好,比如员工之前关系很微妙(勾心斗角),时不时就被人算计,时间久了可能就会考虑换工作,除非你也属于那种非常善于处理人际很关系或是本身就非常享受这种公司内部文化氛围(其实是玩弄权术)。如果前面这两个条件用人单位都能满足你,你还是可能会选择换工作,比如公司的业务发展主线和你的职业发展不是同一条线,这样会使你觉得自己的价值未能体现(我就是因为这个原因有了想换工作的念头)。即便前面说的这些情况公司都达到了你的要求,还有一个很重要原因也会使你换工作,是否一个好的领导,因为从某种程度而言,他直接决定了你在公司的发展空间。上面提到了我个人对于选择一份工作的一点观点,当然我们有时选择换工作,还有很多其他的原因,比如希望回到家人身边或是去女朋友所在城市工作。。。

从去年9月份,我就第一个从学校当了逃兵,如今转眼一年多了,2013马上终结,2014即将开始,在工作的这一年里,我曾忙碌过(不敢说奋斗过),也曾迷茫过,也被鄙视过。为了踏入现在的行业,我曾花费了很多的时间和money,虽然当时我觉得这一切对我很重要,但如今等真正实现了当初的目标(不敢再称之为梦想),已然没有曾经那种激情澎湃和兴奋的感觉,或许这就是我们的贪婪,又或是所谓的追求。在工作的这一年中,多数时间我都在外地跑来跑去,我很喜欢这种忙碌的快感,但有时也很觉得很累,不过时间已经帮我适应了这一切。

谈谈这一年的工作感受(只谈我本行业),作为一个属于IT行业但却有别于码农的IT男,一开始如何选择一家适合自己发展的公司是比较重要的(这需要根据自己职业发展计划去选择),一般就两种情况:①甲方,比如银行、电网、百度、联想等;②第三方,比如神码、华胜天成、东软、东华等。甲方工作稳定,自己搞不定的事情请第三方的人来做,出了问题也不用承担责任。第三方主要服务于甲方,7*24响应,因此工作时间上没有甲方稳定,可能有时候还会受气,但这并不表明第三方就没有甲方好。因为前面已经说过,我们选择一份工作都有自己的标准和原则,比如作为一个技术追求者,在刚开始参加工作肯定会选择第三方,因为这样可以迅速提升自己的技术能力,增加自己的工作经验和技术面,等专业技术能力达到一定的高度,想要稳定下来就选择转入甲方,做一个架构师。其实无论是甲方还是第三方,选择走技术路线的人,最终归宿就两种,一是对于技术有狂热的追求,一辈子选择做技术,另一种就是转管理,一般而言都会选择后者,因为当你技术真正达到无人能及的高度,你肯定已经不再是一个普通的工程师,至少也会是一个团队的负责人。

我们每个人都会经常抱怨自己公司怎么怎么不好,其实我想说的是:你想要从公司那里得到什么,得为公司付出什么。就拿我自己来说,我们公司是一个美国控股的小公司,因此对工程师的管理制度也很灵活,没有case时也可以不用去公司坐班,去公司也不用打卡,加班有餐补和加班费(虽然加班费少),出差可以根据自己的喜好选择飞机或是火车出行,请假及报销制度也很灵活,公司同事之间关系很单纯(可能大家都是做技术的)。基于这些原因,我最终还是拒绝了这家给我两次工作机会的单位,说实话这家提供给我两次机会的公司其实真的不错,首先公司规模是我现在公司的5倍,公司管理制度完善,员工会有更多职业培训机会,技术团队支持更到位,最重要的是给我薪资比我现在每月高快3000,但是我还是拒绝了这次机会,因为我已经习惯了自由,习惯了简单。一般这种已经具有一定规模的公司,由于各项管理制度已经很完善,因此对于员工的要求也很多,比如一个事假,可能要经过三层甚至更高层的审批,我无法接受诸如这样的制度,因此我宁愿选择每月少赚3000块钱,因为我想得到自由和简单。

最后值强调一点:你能为公司做什么,公司才能为你提供什么,与君共勉之!