Oracle RAC 添加和删除OCR
Oracle RAC 备份和恢复OCR 参考:http://blog.csdn.net/laoshangxyc/article/details/8688705
Oracle Clusterware最多只支持两个OCR,一个普通OCR,一个镜像OCR.如果采用的External Redundancy方式存储OCR,那么还可以添加一个镜像OCR,
如果才用的Normal Redundancy的方式存储OCR那么则不能再添加。
添加普通OCR方法如下:
ocrconfig -replace ocr destination_file ocrconfig -replace ocr disk--destination_file或disk为想要添加的OCR存储位置
添加镜像OCR方法如下:
ocrconfig -replace ocrmirror destination_file ocrconfig -replace ocrmirror disk--destination_file或disk为想要添加的OCR存储位置
--以上要用root用户执行
示例添加镜像OCR:
1.查看系统当前OCR情况
- [oracle@node1 ~]$ ocrcheck
- Status of Oracle Cluster Registry is as follows :
- Version : 2
- Total space (kbytes) : 104344
- Used space (kbytes) : 3816
- Available space (kbytes) : 100528
- ID : 497615595
- Device/File Name : /dev/raw/raw1
- Device/File integrity check succeeded
- Device/File not configured
- Cluster registry integrity check succeeded
看到当前系统只有一个OCR存储(为普通OCR),在/dev/raw/raw1.
如果此时再添加一个普通OCR,则会报如下错误
- [root@node1 bin]# ./ocrconfig -replace ocr /dev/raw/raw7
- PROT-16: Internal Error
2.添加一个镜像OCR
- [root@node1 bin]# ./ocrconfig -replace ocrmirror /dev/raw/raw7
3.查看添加后的OCR情况
- [oracle@node1 crs_1]$ ocrcheck
- Status of Oracle Cluster Registry is as follows :
- Version : 2
- Total space (kbytes) : 104344
- Used space (kbytes) : 3816
- Available space (kbytes) : 100528
- ID : 497615595
- Device/File Name : /dev/raw/raw1
- Device/File integrity check succeeded
- Device/File Name : /dev/raw/raw7
- Device/File integrity check succeeded
- Cluster registry integrity check succeeded
可以看到添加成功
删除普通OCR方法如下:
ocrconfig -replace ocr
删除镜像OCR方法如下:
ocrconfig -replace ocrmirror
示例删除普通OCR:
- [root@node1 bin]# ./ocrconfig -replace ocr
- [oracle@node1 crs_1]$ ocrcheck
- Status of Oracle Cluster Registry is as follows :
- Version : 2
- Total space (kbytes) : 153496
- Used space (kbytes) : 3816
- Available space (kbytes) : 149680
- ID : 497615595
- Device/File Name : /dev/raw/raw7
- Device/File integrity check succeeded
- Device/File not configured
- Cluster registry integrity check succeeded
注:删除普通OCR后,镜像ocr即为普通ocr,所以此时依然无法添加普通ocr,所以ocrconfig -replace ocr destination_file这个命令可能在第一创建ocr的时候才会用到。
示例删除镜像OCR
- --查看raw7为普通OCR,raw8为镜像ocr
- [oracle@node1 crs_1]$ ocrcheck
- Status of Oracle Cluster Registry is as follows :
- Version : 2
- Total space (kbytes) : 153496
- Used space (kbytes) : 3816
- Available space (kbytes) : 149680
- ID : 497615595
- Device/File Name : /dev/raw/raw7
- Device/File integrity check succeeded
- Device/File Name : /dev/raw/raw8
- Device/File integrity check succeeded
- Cluster registry integrity check succeeded
- --删除镜像ocr
- [root@node1 bin]# ./ocrconfig -replace ocrmirror
- --可以看到raw8已经被删除
- [oracle@node1 crs_1]$ ocrcheck
- Status of Oracle Cluster Registry is as follows :
- Version : 2
- Total space (kbytes) : 153496
- Used space (kbytes) : 3816
- Available space (kbytes) : 149680
- ID : 497615595
- Device/File Name : /dev/raw/raw7
- Device/File integrity check succeeded
- Device/File not configured
- Cluster registry integrity check succeeded
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/27677524/viewspace-773509/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/27677524/viewspace-773509/