这个命令在执行过程中,会在$CRS_HOME\\log\\
3.2.2 ocrcheck
Ocrcheck 命令用于检查OCR内容的一致性,命令执行过程会在
$CRS_HOME\\log\\nodename\\client 目录下产生ocrcheck_pid.log 日志文件。 这个命令不需要参数。
[root@raw1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 147352
Used space (kbytes) : 4360
Available space (kbytes) : 142992
ID : 1599790592
Device/File Name : /dev/raw/raw1
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
3.2.3 ocrconfig
该命令用于维护OCR 磁盘,安装clusterware过程中,如果选择External Redundancy冗余方式,则只能输入一个OCR磁盘位置。 但是Oracle允许配置两个OCR 磁盘互为镜像,以防止OCR 磁盘的单点故障。 OCR 磁盘和Votedisk磁盘不一样,OCR磁盘最多只能有两个,一个Primary OCR 和一个Mirror OCR。
[root@raw1 bin]# ./ocrconfig --help Name:
ocrconfig - Configuration tool for Oracle Cluster Registry.
Synopsis:
ocrconfig [option]
option:
-export
- Export cluster register contents to a file
-import
-upgrade [
- Upgrade cluster registry from previous version
-downgrade [-version
- Downgrade cluster registry to the specified version
-backuploc
-showbackup - Show backup information
-restore
-replace ocr|ocrmirror [
-overwrite - Overwrite OCR configuration on disk
-repair ocr|ocrmirror
-help - Print out this help information Note:
A log file will be created in
$ORACLE_HOME/log/
you have file creation privileges in the above directory before
running this tool.
-- 查看自助备份
[root@raw1 bin]# ./ocrconfig -showbackup
在缺省情况下,OCR自动备份在$CRS_HOME\\CRS\\CDATA\\cluster_name 目录下,可以通过ocrconfig -backuploc
3.2.4 使用导出,导入进行备份和恢复
Oracle 推荐在对集群做调整时,比如增加,删除节点之前,应该对OCR做一个备份,可以使用export 备份到指定文件,如果做了replace或者restore 等操作,Oracle 建议使用 cluvfy comp ocr -n all 命令来做一次全面的检查。该命令在clusterware 的安装软件里。
1) 首先关闭所有节点的CRS
[root@raw1 bin]# ./crsctl stop crs
Stopping resources.
Successfully stopped CRS resources
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
2) 用root 用户导出OCR内容