oracle 11g GRID 中 关于 OLR 须要知道的一些内容



oracle 11g GRID 中 关于 OLR 须要知道的一些内容

1.检查olr 的状态:
[root@vmrac1 ~]# ocrcheck -local
Status of Oracle Local Registry is as follows :
         Version                  :          3
         Total space (kbytes)     :     262120
         Used space (kbytes)      :       2748
         Available space (kbytes) :     259372
         ID                       :  935756415
         Device/File Name         : /u02/app/11.2.0.3/grid/cdata/vmrac1.olr
                                    Device/File integrity check succeeded
         Local registry integrity check succeeded
         Logical corruption check succeeded


2.将olr的内容转储到txt 文档,可查看olr的内容:

# ocrdump -local -stdout


3.导出/导入 olr 的内容:
--- 导出 OLR
# ocrconfig –local –export file_name

/*file_name 为导入文件,导出的文件名称。这个文件名称是自定的 eg:olr_myhost1_20090603_0130_export */


--- 导入 OLR:
# ocrconfig –local –import file_name

/*file_name 为导入文件。导出的文件名称。这个文件名称是自定的 eg:olr_myhost1_20090603_0130_export */


note:
》 Oracle recommends that you use the -manualbackup and -restorecommands and not the -importand -exportcommands.
》 When exporting OLR, Oracle recommends including "olr", the host name, and the timestamp in the name string.
For example:olr_myhost1_20090603_0130_export


4.手动备份OLR:

# ocrconfig –local –manualbackup

olr 会在grid 安装完毕后,或者升级后备份一次。之后就不会自己主动备份 。oracle 建议在对 ocr 存储迁移后对OLR 进行手动备份一次。

**OLR缺省备份文件夹:Grid_home/cdata/host_name.
----改动OLR 备份文件夹:
ocrconfig -local -backuploc new_olr_backup_path

----查看olr 备份文件内容:
ocrdump -local -backupfile olr_backup_file_name


这里须要注意下 olr:ocrconfig  -manualbackup 和 ocrconfig -local -restore 是配套使用的,ocrconfig -local -export 和 ocrconfig -local -import 是配套使用的,也就是说 ocrconfig -local -export  file_name 导出的文件不用用作 ocrconfig -local -restore 使用




5.还原OLR:
To restore OLR:
----停crs
# crsctl stop crs

----恢复OLR:
# ocrconfig -local -restore file_name    /*file_name为olr的备份路径中的文件名称。能够通过 ocrconfig -local -showbackup 来查看*/

-----确认olr 的状态(检查olr 内容的逻辑完整性):
# ocrcheck -local

----重新启动crs
# crsctl start crs

----使用cvu验证olr 在集群中的完整性(注意:不检查olr 内容的逻辑完整性)
$ cluvfy comp olr

grid@vmrac1 ~]$ cluvfy comp olr

Verifying OLR integrity
Checking OLR integrity...
Checking OLR config file...
OLR config file check successful
Checking OLR file attributes...
OLR file check successful

WARNING:
This check does not verify the integrity of the OLR contents. Execute 'ocrcheck -local' as a privileged user to verify the

contents of OLR.

OLR integrity check passed
Verification of OLR integrity was successful.


原文地址:https://www.cnblogs.com/lytwajue/p/7130399.html