下面讨论有关11gR2 OCRDUMP命令的使用。首先获取OCRDUMP的帮助信息:
[root@rhel1 bin]# ./ocrdump -h
Name:
ocrdump - Dump contents of Oracle Cluster/Local Registry to a file.
Synopsis:
ocrdump [-local] [|-stdout] [-backupfile ] [-keyname ] [-xml] [-noheader]
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
prompt> ocrdump -local -stdout -xml
writes local registry contents to stdout in xml format
prompt> ocrdump -backupfile /oracle/CRSHOME/backup.ocr -stdout -xml
writes registry contents in the backup file to stdout in xml format
Notes:
The header information will be retrieved based on best effort basis.
A log file will be created in
$ORACLE_HOME/log//client/ocrdump_.log. Make sure
you have file creation privileges in the above directory before
running this tool.
Use option '-local' to indicate that the operation is to be performed on the Oracle Local Registry. OCRDUMP工具允许DUMP OCR或者OLR的内容到文件或者标准输出,基于诊断和管理目的读取其中的内容,OCRDUMP的参数包括:
-stdout – 将输出的内容传送到终端。
-local – 指定该参数输出的是OLR的内容。
-Backupfile – 查看OCR/OLR备份文件的内容,参数后面要跟上参数文件名称。
-keyname – DUMP一个指定的OCR键(OCRDUMP的内容是以键值对存在)。
-xml – DUMP以XML格式输出。
-noheader – 在输出中不打印出头信息。当执行OCRDUMP操作的时候会创建一个日志文件,这个日志文件的存储位置是$GRID_HOME/log//client/ocrdump_.log,可以对输出的日志级别进行调整,可以通过编辑ocrlog.ini文件来修改日志级别。如果在执行OCRDUMP的时候报错,可以根据生成的日志文件来判断错误原因。
OCR是以树形结构在OCR文件中存储数据,数据的存储形式是键值对。通过对OCRDUMP文件的分析,可以发现它的大体结构如下:
root
├─SYSTEM
│ ├─css
│ ├─language
│ ├─version
│ ├─ORA_CRS_HOME
│ ├─local_only
│ ├─evm
│ ├─crs
│ └─OCR
├─DATABASE
│ ├─NODEAPPS
│ ├─LOG
│ ├─ASM
│ ├─DATABASES
│ │ ├─SERVICE
│ │ └─INSTANCE
│ └─ONS
└─CRS
简单对上述三类键值的功能做下述简要描述:
1)SYSTEM键包含了与Oracle Clusterware主要进程CSSD、CRSD和EVMD的相关数据;
2)DATABASE键包含了在Oracle Clusterware注册的RAC数据库相关的数据;
3)OCR键记录了与资源概要文件相关的信息,维护其他注册到Oracle Clusterware的应用程序的可用性。
参考资料:http://space.itpub.net/519536/viewspace-678008