Oracle 10g RAC OCRVoting disk更换

Posted jyzhao

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Oracle 10g RAC OCRVoting disk更换相关的知识,希望对你有一定的参考价值。

环境:OEL 5.7 + Oracle 10.2.0.5 RAC
需求:更换存储,OCR、Voting disk同时需要更换到新存储。

1.替换OCR

替换OCR(Oracle Cluster Registry)首先需要关闭RAC所有节点的crs,然后导出当前的ocr配置文件,手工修改ocr.loc文件后,导入ocr配置文件,可选择性创建ocrmirror。
本次实验演示就是将原来的/dev/raw/raw1替换为/dev/raw/raw14,并创建ocrmirror为/dev/raw/raw15.

--replace ocr
--两个节点关闭crs
/s01/oracle/product/10.2.0/crs_1/bin/crsctl stop crs
--ocrcheck
/s01/oracle/product/10.2.0/crs_1/bin/ocrcheck 
--导出ocr的配置
/s01/oracle/product/10.2.0/crs_1/bin/ocrconfig -export /tmp/ocrfile.dmp 
--查看文件大小
ls -lrt /tmp/ocrfile.dmp 
--两个节点修改ocr为新的/dev/raw/raw14
cat /etc/oracle/ocr.loc 
--导入ocr配置文件
/s01/oracle/product/10.2.0/crs_1/bin/ocrconfig -import /tmp/ocrfile.dmp 
/s01/oracle/product/10.2.0/crs_1/bin/ocrcheck 
--增加ocrmirror
/s01/oracle/product/10.2.0/crs_1/bin/ocrconfig -replace ocrmirror /dev/raw/raw15
/s01/oracle/product/10.2.0/crs_1/bin/ocrcheck
--最后查看ocr.loc文件
cat /etc/oracle/ocr.loc 

实际测试替换OCR的关键操作:

[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/crsctl stop crs
[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/ocrconfig -export /tmp/ocrfile.dmp 
[[email protected] rules.d]# vi /etc/oracle/ocr.loc 
ocrconfig_loc=/dev/raw/raw14
local_only=FALSE
[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/ocrconfig -replace ocrmirror /dev/raw/raw15
[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/ocrcheck
Status of Oracle Cluster Registry is as follows :
         Version                  :          2
         Total space (kbytes)     :      96144
         Used space (kbytes)      :       4652
         Available space (kbytes) :      91492
         ID                       : 1953645605
         Device/File Name         : /dev/raw/raw14
                                    Device/File integrity check succeeded
         Device/File Name         : /dev/raw/raw15
                                    Device/File integrity check succeeded

         Cluster registry integrity check succeeded

[[email protected] ~]#  cat /etc/oracle/ocr.loc 
#Device/file  getting replaced by device /dev/raw/raw15 
ocrconfig_loc=/dev/raw/raw14
ocrmirrorconfig_loc=/dev/raw/raw15
local_only=false
[[email protected] ~]# 

2.替换voting disk

替换voting disk比较简单,只需要把新的voting disk加进来,然后把旧的删除即可。
本次实验演示就是新加/dev/raw/raw11,/dev/raw/raw12,/dev/raw/raw13,然后将原来的/dev/raw/raw2删除。

--replace voting disk
--which crsctl确认crsctl的全路径
/s01/oracle/product/10.2.0/crs_1/bin/crsctl
--查询当前的votedisk
crsctl query css votedisk
--添加新的votedisk
crsctl add css votedisk /dev/raw/raw11 -force
crsctl add css votedisk /dev/raw/raw12 -force
crsctl add css votedisk /dev/raw/raw13 -force
--删除旧的votedisk
crsctl delete css votedisk /dev/raw/raw2 -force

实际替换voting disk的关键操作:

[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/crsctl add css votedisk /dev/raw/raw11 
Cluster is not in a ready state for online disk addition
[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/crsctl add css votedisk /dev/raw/raw11 -force
Now formatting voting disk: /dev/raw/raw11
successful addition of votedisk /dev/raw/raw11.
[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/crsctl query css votedisk
 0.     0    /dev/raw/raw2
 1.     0    /dev/raw/raw11

located 2 votedisk(s).
[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/crsctl add css votedisk /dev/raw/raw12 -force
Now formatting voting disk: /dev/raw/raw12
successful addition of votedisk /dev/raw/raw12.
[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/crsctl add css votedisk /dev/raw/raw13 -force
Now formatting voting disk: /dev/raw/raw13
successful addition of votedisk /dev/raw/raw13.
[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/crsctl query css votedisk
 0.     0    /dev/raw/raw2
 1.     0    /dev/raw/raw11
 2.     0    /dev/raw/raw12
 3.     0    /dev/raw/raw13

located 4 votedisk(s).
[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/crsctl delete css votedisk /dev/raw/raw2
Cluster is not in a ready state for online disk removal
[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/crsctl delete css votedisk /dev/raw/raw2 -force
successful deletion of votedisk /dev/raw/raw2.
[[email protected] rules.d]# /s01/oracle/product/10.2.0/crs_1/bin/crsctl query css votedisk
 0.     0    /dev/raw/raw11
 1.     0    /dev/raw/raw12
 2.     0    /dev/raw/raw13

located 3 votedisk(s).
[[email protected] rules.d]# 

附录:本次实验环境:
1.旧存储模拟:4块盘:其中第1块盘分成了2个区,绑定为raw设备raw1和raw2,分别给ocr和voting disk使用,剩余3块是给ASM使用的:
技术图片
2.新存储模拟:10块盘:其中前三块(raw11,raw12,raw13)给voting disk使用,第4块和第5块(raw14和raw15)给ocr使用:
技术图片
3.使用新存储3块10G的盘和2块5G的盘分别新增DATADG和FRA2个ASM磁盘组,其中DATADG是Normal冗余,FRA是External冗余:
技术图片

以上是关于Oracle 10g RAC OCRVoting disk更换的主要内容,如果未能解决你的问题,请参考以下文章

ORACLE10g R2RAC+ASM→RAC+ASM

AIX下RAC搭建 Oracle10G安装oracle建立监听

Goldengate 部署oracle10g在 rac asm环境,完整教程

oracle10G rac asm 安装总结

oracle 10g rac环境升级到10.2.0.5

Oracle10g RAC在线更换OCR votedisk