5、重定位OCR
重定位OCR,也称之为移动OCR文件,也就是将当前的OCR或者镜像的OCR放置到新的裸设备后者OCFS上。对于整个操作可以在联机的情形下完成
不论是移动primary ocr还是mirror ocr,其依赖的ocr必须存在。也就是说必须要有两份ocr存在,否则收到PROT-16: Internal Error
使用下面的命令移动primary ocr
ocrconfig -replace ocr
ocrconfig -replace ocr
现在我们将primary ocr移动到之前的raw11上
Oracle@bo2dbp:~> dd if=/dev/zero of=/dev/raw/raw11 bs=1024k count=210
dd: writing `/dev/raw/raw11': No space left on device
200+0 records in
199+0 records out
209698816 bytes (210 MB) copied, 5.39183 seconds, 38.9 MB/s
oracle@bo2dbp:~> sudo -s /u01/oracle/crs/bin/ocrconfig -replace ocr /dev/raw/raw11
oracle@bo2dbp:~> ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 204560
Used space (kbytes) : 6184
Available space (kbytes) : 198376
ID : 1512159503
Device/File Name : /dev/raw/raw11 #可以看到,此处之前的raw1被新的raw11代替
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw21
Device/File integrity check succeeded
Cluster registry integrity check succeeded
使用下面的命令移动mirror ocr,关于mirro ocr的移动此处不做演示
ocrconfig -replace ocrmirror
ocrconfig -replace ocrmirror
6、本地节点OCR的修复
对于任一节点的clusterware处于关闭状态或者节点主机被关闭的情形,其他节点对ocr配置的更改将使得处于被停机或关闭的clusterware
节点ocr信息与出现不一致的情形。比如在第二个节点处于关闭的情形下,对第一个节点进行了ocr的添加,移出,重定位等等操作,对于这
种情形则需要在关闭的节点进行ocr修复处理。修复仅仅在clusterware守护进程处于关闭下完成。
使用下面的命令修复ocr,repair参数仅仅作用于所在的节点
ocrconfig -repair ocr device_name #修复primary ocr,
ocrconfig -repair ocrmirror device_name #修复mirror ocr
在前面的一个示例中我们将primary 的ocr用原来的raw1变成了raw11,在这个操作期间,节点2已经意外宕机。
下面来查看节点2的ocr.loc
下面的ocr.loc中primary还是raw1,而上一个操作已经变成了raw11
bo2dbs:/u01/oracle/crs/log/bo2dbs # more /etc/oracle/ocr.loc
#Device/file /dev/raw/raw11 getting replaced by device /dev/raw/raw21
ocrconfig_loc=/dev/raw/raw1
ocrmirrorconfig_loc=/dev/raw/raw21
local_only=false
bo2dbs:/u01/oracle/crs/bin # ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
#此时bo2dbs上集群无法启动
bo2dbs:/u01/oracle/crs/bin # ./crsctl check crs
Failure 1 contacting CSS daemon
Cannot communicate with CRS
Cannot communicate with EVM
bo2dbs:/u01/oracle/crs/bin # ps -ef | grep d.bin | grep -v grep #没有看到任何集群相关的进程
bo2dbs:/u01/oracle/crs/bin # tail -2 /u01/oracle/crs/log/bo2dbs/alertbo2dbs.log #查看日志文件
2013-01-07 17:13:49.153
[client(12071)]CRS-1009:The OCR configuration is invalid. Details in /u01/oracle/crs/log/bo2dbs/client/css37.log.
bo2dbs:/u01/oracle/crs/bin # more /u01/oracle/crs/log/bo2dbs/client/css37.log #查看日志文件
Oracle Database 10g CRS Release 10.2.0.1.0 Production Copyright 1996, 2005 Oracle. All rights reserved.
2013-01-07 17:13:49.153: [ OCRRAW][190773584]proprioini: OCR configuration on disk 1 isn't valid
2013-01-07 17:13:49.153: [ OCRRAW][190773584]proprinit: Could not open raw device
2013-01-07 17:13:49.153: [ default][190773584]a_init:7!: Backend init unsuccessful : [26]
2013-01-07 17:13:49.153: [ CSSCLNT][190773584]clsssinit:
Unable to access OCR device in OCR init.PROC-26: Error while accessing the physical storage
#从上面的日志可知,在磁盘1上ocr配置无效,也就是不能打开裸设备raw1
#下面我们来尝试修复
bo2dbs:/u01/oracle/crs/bin # ./ocrconfig -repair ocr /dev/raw/raw11
bo2dbs:/u01/oracle/crs/bin # more /etc/oracle/ocr.loc
#Device/file /dev/raw/raw1 getting replaced by device /dev/raw/raw11
ocrconfig_loc=/dev/raw/raw11
ocrmirrorconfig_loc=/dev/raw/raw21
local_only=false
bo2dbs:/u01/oracle/crs/bin # ./crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
bo2dbs:/u01/oracle/crs/bin # ./crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy
bo2dbs:/u01/oracle/crs/bin # ps -ef | grep d.bin | grep -v grep
root 14459 5067 0 17:33 ? 00:00:01 /u01/oracle/crs/bin/crsd.bin reboot
oracle 14512 5065 0 17:33 ? 00:00:00 /u01/oracle/crs/bin/evmd.bin
oracle 15128 14426 0 17:33 ? 00:00:01 /u01/oracle/crs/bin/ocssd.bin
bo2dbs:/u01/oracle/crs/bin # ./crs_stat -t | grep bo2dbs
ora....SM2.asm application ONLINE ONLINE bo2dbs
ora....BS.lsnr application ONLINE ONLINE bo2dbs
ora....BS.lsnr application ONLINE ONLINE bo2dbs
ora.bo2dbs.gsd application ONLINE ONLINE bo2dbs
ora.bo2dbs.ons application ONLINE ONLINE bo2dbs
ora.bo2dbs.vip application ONLINE ONLINE bo2dbs
ora....g2.inst application ONLINE ONLINE bo2dbs