下面讨論有關11gR2 OCRDUMP指令的使用。首先擷取OCRDUMP的幫助資訊:
[root@rhel1 bin]# ./ocrdump -h
Name:
ocrdump - Dump contents of Oracle Cluster/Local Registry to a file.
Synopsis:
ocrdump [-local] [<filename>|-stdout] [-backupfile <backupfilename>] [-keyname <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/<hostname>/client/ocrdump_<pid>.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/<host_name>/client/ocrdump_<pid>.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的應用程式的可用性。
參考資料:
<a href="http://space.itpub.net/519536/viewspace-678008">http://space.itpub.net/519536/viewspace-678008</a>
<a href="http://www.toadworld.com/KNOWLEDGE/KnowledgeXpertforOracle/tabid/648/TopicID/RACR2MAN3/Default.aspx">http://www.toadworld.com/KNOWLEDGE/KnowledgeXpertforOracle/tabid/648/TopicID/RACR2MAN3/Default.aspx</a>