替换OCR磁盘组的步骤
1、添加新存储
2、多路径绑定配置
3、ASMLib 配置或udev绑定
4、备份OCR
5、新建OCR卷组
6、替换VOTE在其中一个节点,root用户下执行:
[root]# crsctl query css votedisk -----修改前确认表决磁盘的位置 ## STATE File Universal Id File Name Disk group - ----- ----------------- --------- --------- 1. ONLINE 904eec4b28014f51bf5c23fbdb330aef (/dev/asm-disk1) [OCR] Located 1 voting disk(s). [root@cwhxdb2 bin]# crsctl replace votedisk +FRA Successful addition of voting disk 8324947e1f494f06bf6c01f6bd5940c9. Successful deletion of voting disk 904eec4b28014f51bf5c23fbdb330aef. Successfully replaced voting disk group with +FRA. CRS-4266: Voting file(s) successfully replaced [root@cwhxdb2 bin]# ./crsctl query css votedisk -----修改后确认表决磁盘的位置 ## STATE File Universal Id File Name Disk group -- ----- ----------------- --------- --------- 1. ONLINE 8324947e1f494f06bf6c01f6bd5940c9 (/dev/asm-disk5) [FRA]
7、替换OCR 在grid或root用户下执行,只需要在一个节点上操作即可
主要命令:
ocrconfig -add +newocr
more /etc/oracle/ocr.loc
ocrconfig -delete +ocr
more /etc/oracle/ocr.loc
ocrcheck
more /etc/oracle/ocr.loc
ocrconfig -delete +ocr
more /etc/oracle/ocr.loc
ocrcheck
[root@cwhxdb2 bin]# ./ocrconfig -add +fra [root@cwhxdb2 bin]# more /etc/oracle/ocr.loc #Device/file getting replaced by device +fra ocrconfig_loc=+OCR ocrmirrorconfig_loc=+fra local_only=false [root@cwhxdb2 bin]# ocrconfig -delete +ocr [root@cwhxdb2 bin]# ocrcheck Status of Oracle Cluster Registry is as follows : Version : 3 Total space (kbytes) : 262120 Used space (kbytes) : 2948 Available space (kbytes) : 259172 ID : 495741472 Device/File Name : +fra 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 [root@cwhxdb2 bin]# more /etc/oracle/ocr.loc #Device/file +OCR getting replaced by device +fra ocrconfig_loc=+fra local_only=false
8、迁移ASM Spfile (和实例的spfile是两码事)grid用户执行
[root]# su - grid [root]# asmcmd >spget ----找到ASM spfile的位置 >spcopy -u +OCR/rac-scan/asmparameterfile/registry.253.1050699607 +FRA/rac-scan/asmparameterfile/spfileasm.ora >spset +FRA/rac-scan/asmparameterfile/registry.253.1050699607 #[grid@cwhxdb1 ~]$ asmcmd ASMCMD> spget +OCR/rac-scan/asmparameterfile/registry.253.1050699607 ASMCMD> spcopy -u +OCR/rac-scan/asmparameterfile/registry.253.1050699607 +FRA/rac-scan/asmparameterfile/spfileasm.ora ASMCMD> spset +FRA/rac-scan/asmparameterfile/spfileasm.ora ASMCMD> spget +FRA/rac-scan/asmparameterfile/spfileasm.ora
9、确认老的OCR磁盘组是否还有其他文件
ASMCMD> cd ocr ASMCMD> ls rac-scan/ ASMCMD> cd ra* ASMCMD> ls ASMPARAMETERFILE/ OCRFILE/ ASMCMD> cd asm* ASMCMD> ls REGISTRY.253.1050699607 #### 不用管,已迁移 ASMCMD> cd .. ASMCMD> ls ASMPARAMETERFILE/ OCRFILE/ ASMCMD> cd ocrfile ASMCMD> ls REGISTRY.255.1050699611 #### 不用管,已迁移
10、删除老OCR卷组
在节点1和节点2分别重启集群
crsctl stop crs crsctl start crs
节点2:
su - grid sqlplus / as sysasm alter diskgroup OCR dismount; exit
节点1:
su - grid sqlplus / as sysasm drop diskgroup ocr; ------看执行结果,不行就执行下一条命令 drop diskgroup OCR INCLUDING CONTENTS; ------看执行结果,不行就执行下一条命令 drop diskgroup OCR FORCE INCLUDING CONTENTS;
11、删除磁盘
任意一节点ROOT用户下操作:
/usr/sbin/oracleasm dropdisk OCR
删除多路径绑定配置,删除配置/etc/multipatch.conf中原有OCR盘内容
最后从存储上删除2个节点的映射。
12、删除crs记录
crsctl delete res ora.OCR.dg