ocrcheck PROT-602 错误和ocrconfig PROT-1错误
Dec212012
今天一早到公司,准备迁移VOTEDISK,在ocrcheck时在第二个节点报PROT-602: Failed to retrieve data from the cluster registry错误:
[root@node2 ~]# ocrcheck PROT-602: Failed to retrieve data from the cluster registry
使用ocrconfig更改OCR路径时,报PROT-1: Failed to initialize ocrconfig错误:
[root@node2 ~]# ocrconfig -replace ocrmirror /dev/raw/raw8 PROT-1: Failed to initialize ocrconfig
检查裸设备信息:
[root@node2 ~]# ls -l /dev/raw/raw* crw-r----- 1 oracle oinstall 162, 1 Dec 19 10:07 /dev/raw/raw1 crw-r----- 1 oracle oinstall 162, 2 Dec 21 10:35 /dev/raw/raw2 crw-r----- 1 oracle oinstall 162, 4 Dec 21 10:35 /dev/raw/raw4 crw-r----- 1 oracle oinstall 162, 5 Dec 19 09:17 /dev/raw/raw5 crw-r----- 1 oracle oinstall 162, 7 Dec 21 10:31 /dev/raw/raw7 crw-r----- 1 oracle oinstall 162, 8 Dec 21 10:31 /dev/raw/raw8
在节点1上执行ocrcheck检查OCR信息:
[root@node1 ~]# ocrcheck Status of Oracle Cluster Registry is as follows : Version : 2 Total space (kbytes) : 195804 Used space (kbytes) : 4612 Available space (kbytes) : 191192 ID : 1398039632 Device/File Name : /dev/raw/raw4 Device/File integrity check failed n Device/File Name : /dev/raw/raw5 Device/File integrity check succeeded Cluster registry integrity check succeeded
检查节点1的裸设备信息:
[root@node1 ~]# ls -l /dev/raw/raw* crw-r----- 1 oracle oinstall 162, 1 Dec 21 02:02 /dev/raw/raw1 crw-r----- 1 oracle oinstall 162, 2 Dec 21 02:37 /dev/raw/raw2 crw-r----- 1 oracle oinstall 162, 3 Dec 21 02:09 /dev/raw/raw3 crw-r----- 1 oracle oinstall 162, 4 Dec 21 02:37 /dev/raw/raw4 crw-r----- 1 oracle oinstall 162, 5 Dec 21 02:04 /dev/raw/raw5
导致ocrcheck时PROT-602错误的原因是在节点1,使用ocrconfig命令将OCR迁移至raw4和raw5设备上,而节点2上raw4和raw5是ASM磁盘,ORACLE无法将OCR信息写到ASM磁盘上(11g版本OCR可以存放到ASM磁盘上),所以节点2报错。导致ocrconfig时PROT-1错误的原因是在节点1上没有raw7和raw8设备。
修改节点1的UDEV,将raw4和raw5绑定到raw7和raw8,再将OCR迁移到raw7和raw8设备上,即可解决问题。
[root@node1 ~]# vi /etc/udev/rules.d/60-raw.rules # Enter raw device bindings here. # # An example would be: # ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N" # to bind /dev/raw/raw1 to /dev/sda, or # ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m" # to bind /dev/raw/raw2 to the device with major 8, minor 1. ACTION=="add",KERNEL=="vdb1",RUN+="/bin/raw /dev/raw/raw1 %N" ACTION=="add",KERNEL=="vdb2",RUN+="/bin/raw /dev/raw/raw2 %N" ACTION=="add",KERNEL=="vdb3",RUN+="/bin/raw /dev/raw/raw3 %N" ACTION=="add",KERNEL=="vde1",RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add",KERNEL=="vde1",RUN+="/bin/raw /dev/raw/raw7 %N" ACTION=="add",KERNEL=="vde2",RUN+="/bin/raw /dev/raw/raw5 %N" ACTION=="add",KERNEL=="vde2",RUN+="/bin/raw /dev/raw/raw8 %N" KERNEL=="raw*", OWNER="oracle", GROUP="oinstall", MODE="640"
重启UDEV使之生效:
[root@node1 ~]# start_udev Starting udev: [ OK ] [root@node1 ~]# ls -l /dev/raw/raw* crw-r----- 1 oracle oinstall 162, 1 Dec 21 02:02 /dev/raw/raw1 crw-r----- 1 oracle oinstall 162, 2 Dec 21 02:51 /dev/raw/raw2 crw-r----- 1 oracle oinstall 162, 3 Dec 21 02:09 /dev/raw/raw3 crw-r----- 1 oracle oinstall 162, 4 Dec 21 02:51 /dev/raw/raw4 crw-r----- 1 oracle oinstall 162, 5 Dec 21 02:04 /dev/raw/raw5 crw-r----- 1 oracle oinstall 162, 7 Dec 21 02:51 /dev/raw/raw7 crw-r----- 1 oracle oinstall 162, 8 Dec 21 02:51 /dev/raw/raw8
迁移OCR至raw7和raw8设备上:
[root@node1 ~]# ocrconfig -replace ocrmirror /dev/raw/raw8 [root@node1 ~]# ocrconfig -replace ocr /dev/raw/raw7 root@node1 ~]# ocrcheck Status of Oracle Cluster Registry is as follows : Version : 2 Total space (kbytes) : 195804 Used space (kbytes) : 4612 Available space (kbytes) : 191192 ID : 1398039632 Device/File Name : /dev/raw/raw7 Device/File integrity check failed n Device/File Name : /dev/raw/raw8 Device/File integrity check failed n Cluster registry integrity check failed
再检查节点2的OCR信息,正常。
[root@node2 ~]# ocrcheck Status of Oracle Cluster Registry is as follows : Version : 2 Total space (kbytes) : 195804 Used space (kbytes) : 4612 Available space (kbytes) : 191192 ID : 1398039632 Device/File Name : /dev/raw/raw7 Device/File integrity check failed n Device/File Name : /dev/raw/raw8 Device/File integrity check failed n Cluster registry integrity check failed
解决OCR问题后,需要在修改节点1UDEV的配置,注释掉或删除raw4和raw5的信息:
[root@node1 ~]# vi /etc/udev/rules.d/60-raw.rules # Enter raw device bindings here. # # An example would be: # ACTION=="add", KERNEL=="sda", RUN+="/bin/raw /dev/raw/raw1 %N" # to bind /dev/raw/raw1 to /dev/sda, or # ACTION=="add", ENV{MAJOR}=="8", ENV{MINOR}=="1", RUN+="/bin/raw /dev/raw/raw2 %M %m" # to bind /dev/raw/raw2 to the device with major 8, minor 1. ACTION=="add",KERNEL=="vdb1",RUN+="/bin/raw /dev/raw/raw1 %N" ACTION=="add",KERNEL=="vdb2",RUN+="/bin/raw /dev/raw/raw2 %N" ACTION=="add",KERNEL=="vdb3",RUN+="/bin/raw /dev/raw/raw3 %N" #ACTION=="add",KERNEL=="vde1",RUN+="/bin/raw /dev/raw/raw4 %N" ACTION=="add",KERNEL=="vde1",RUN+="/bin/raw /dev/raw/raw7 %N" #ACTION=="add",KERNEL=="vde2",RUN+="/bin/raw /dev/raw/raw5 %N" ACTION=="add",KERNEL=="vde2",RUN+="/bin/raw /dev/raw/raw8 %N" KERNEL=="raw*", OWNER="oracle", GROUP="oinstall", MODE="640"
这样在下次主机重启后,就不会再有raw4和raw5设备。