0. 0 /dev/raw/raw2
located 1 votedisk(s).
3.2 OCR命令系列
Oracle Clusterware把整个集群的配置信息放在共享存储上,这个存储就是OCR Disk. 在整个集群中,只有一个节点能对OCR Disk 进行读写操作,这个节点叫作Master Node,所有节点都会在内存中保留一份OCR的拷贝,同时有一个OCR Process 从这个内存中读取内容。 OCR 内容发生改变时,由Master Node的OCR Process负责同步到其他节点的OCR Process。
因为OCR的内容如此重要,Oracle 每4个小时对其做一次备份,并且保留最后的3个备份,以及前一天,前一周的最后一个备份。 这个备份由Master Node CRSD进程完成,备份的默认位置是$CRS_HOME/crs/cdata/
1.ocrdump
该命令能以ASCII的方式打印出OCR的内容,但是这个命令不能用作OCR的备份恢复,也就是说产生的文件只能用作 阅读,而不能用于恢复。
命令格式: ocrdump [-stdout] [filename] [-keyname name] [-xml]
参数说明:
-stdout: 把内容打印输出到屏幕上
Filename:内容输出到文件中
-keyname:只打印某个键及其子健内容
-xml:以xml格式打印输出
[root@rac1 bin]# ./ocrdump -stdout -keyname -xml|more
Name:
ocrdump - Dump contents of Oracle Cluster Registry to a file.
Synopsis:
ocrdump [
Description:
Default filename is OCRDUMPFILE. Examples are:
prompt> ocrdump
writes cluster registry contents to OCRDUMPFILE in the current directory
prompt> ocrdump MYFILE
writes cluster registry contents to MYFILE in the current directory
prompt> ocrdump -stdout -keyname SYSTEM
writes the subtree of SYSTEM in the cluster registry to stdout
....
2.ocrcheck
Ocrcheck 命令用于检查OCR内容的一致性,命令执行过程会在$CRS_HOME/log/nodename/client 目录下产生ocrcheck_pid.log 日志文件。 这个命令不需要参数。
[root@rac1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 1048288
Used space (kbytes) : 3804
ID : 887377004
Device/File Name : /dev/raw/raw1
Device/File integrity check succeeded
Device/File not configured
Cluster registry integrity check succeeded
[root@rac1 client]# cat ocrcheck_16964.log
Oracle Database 10g CRS Release 10.2.0.1.0 Production Copyright 1996, 2005 Oracle. All rights reserved.
2014-08-25 13:40:10.491: [OCRCHECK][1566928]ocrcheck starts...
2014-08-25 13:40:12.094: [OCRCHECK][1566928]protchcheck: OCR status : total = [1048288], used = [3804], avail = [1044484]
2014-08-25 13:40:12.095: [OCRCHECK][1566928]Exiting [status=success]...
3.ocrconfig
该命令用于维护OCR 磁盘,安装clusterware过程中,如果选择External Redundancy冗余方式,则只能输入一个OCR磁盘位置。 但是Oracle允许配置两个OCR 磁盘互为镜像,以防止OCR 磁盘的单点故障。 OCR 磁盘和Votedisk磁盘不一样,OCR磁盘最多只能有两个,一个Primary OCR 和一个Mirror OCR。
[root@rac1 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@rac1 bin