oracle 10g rac如何替换ocr 主文件 (crs offline状态)
oracle 10g rac如何替换ocr 主文件 (crs offline状态)
在上一篇文章中 oracle 10g cluster 如何替换ocr主文件,是采用crs online的状态来替换ocr主文件的,这篇我们写的是在crs offline的状态下如何替换ocr主文件
命令如下:
./ocrconfig -repair ocr /dev/rhdisk8
./ocrconfig -overwrite
[root@p650:/crs/app/oracle/product/crs_1/bin]#./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 130852
Used space (kbytes) : 4636
Available space (kbytes) : 126216
ID : 1542042236
Device/File Name : /dev/rhdisk11
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
原来是hdisk11,替换成hdisk8
1.赋予hdisk8 相关 权限(假设hdisk8已经从存储上划分lun出来)
chown root:oinstall /dev/rhdisk8
chmod 640 /dev/rhdisk8
2.两边节点停止crs
crs stop crs
3.用ocrconfig -repair ocr命令来替换
[root@p520:/crs/app/oracle/product/crs_1/bin]#./ocrconfig -repair ocr /dev/rhdisk8
[root@p520:/crs/app/oracle/product/crs_1/bin]#./ocrcheck
PROT-601: Failed to initialize ocrcheck
[root@p520:/crs/app/oracle/product/crs_1/bin]#./ocrconfig -overwrite
PROT-1: Failed to initialize ocrconfig
报PROT-1: Failed to initialize ocrconfig错误,这时我们还需要对ocr盘做个restore
./ocrconfig -showbackup
[root@p650:/crs/app/oracle/product/crs_1/cdata/crs]#ls -ltr
total 54424
-rw-r--r-- 1 root system 3477504 May 26 13:59 week.ocr
-rw-r--r-- 1 root system 4861952 May 27 14:09 backup02.ocr
-rw-r--r-- 1 root system 4878336 May 28 14:48 backup01.ocr
-rw-r--r-- 1 root system 4882432 Jun 02 17:15 backup00.ocr
-rw-r--r-- 1 root system 4882432 Jun 02 17:15 day.ocr
[root@p650:/crs/app/oracle/product/crs_1/bin]#./ocrconfig -restore /crs/app/oracle/product/crs_1/cdata/crs/week_.ocr
[root@p650:/crs/app/oracle/product/crs_1/bin]#./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 130852
Used space (kbytes) : 4636
Available space (kbytes) : 126216
ID : 1542042236
Device/File Name : /dev/rhdisk8
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
已经替换过来,这时我们查
[root@p650:/crs/app/oracle/product/crs_1/log/p650/client]#more ocrconfig_827524.log
日志记录有Exiting [status=success]... 的记录
4.启动crs
crsctl start crs
crs能正常启动,替换成功。