管理Oracle clusterware ( OCR )
管理Oracle clusterware ( OCR )
管理Oracle clusterware ( OCR )
Oracle Clusterware把整个集群的配置信息放在共享存储上,这些信息包括了集群节点的列表、集群数据库实例到节点的映射以及CRS应用程序资源信息。存放的位置就在OCR Disk上. 在整个集群中,只有一个节点能对OCR Disk 进行读写操作,这个节点叫作Master Node,所有节点都会在内存中保留一份OCR的拷贝,同时有一个OCR Process 从这个内存中读取内容。 OCR 内容发生改变时,由Master Node的OCR Process负责同步到其他节点的OCR Process。
If you already mirror the OCR, then you do not need to add an OCR location; Oracle automatically manages two OCRs when it mirrors the OCR. Oracle RAC environments do not support more than two OCRs, a primary OCR and a second OCR.
- --ocrconfig语法
- [root@rac1 ~]# ocrconfig -help
- Name:
- ocrconfig - Configuration tool for Oracle Cluster Registry.
- Synopsis:
- ocrconfig [option]
- option:
- -export <filename> [-s online]
- - Export cluster register contents to a file
- -import <filename> - Import cluster registry contents from a file
- -upgrade [<user> [<group>]]
- - Upgrade cluster registry from previous version
- -downgrade [-version <version string>]
- - Downgrade cluster registry to the specified version
- -backuploc <dirname> - Configure periodic backup location
- -showbackup - Show backup information
- -restore <filename> - Restore from physical backup
- -replace ocr|ocrmirror [<filename>] - Add/replace/remove a OCR device/file
- -overwrite - Overwrite OCR configuration on disk
- -repair ocr|ocrmirror <filename> - Repair local OCR configuration
- -help - Print out this help information
- Note:
- A log file will be created in
- $ORACLE_HOME/log/<hostname>/client/ocrconfig_<pid>.log. Please ensure
- you have file creation privileges in the above directory before
- running this tool.
– 每 4 小时:CRS 会保留最后 3 个副本。
– 每天结束时:CRS 会保留最后 2 个副本。
– 每周结束时:CRS 会保留最后 2 个副本。
自动备份由Master Node CRSD进程完成,备份的默认位置是$CRS_HOME/crs/cdata/<cluster_name>目录下,可以通过ocrconfig -backuploc <directory_name> 命令修改到新的目录。
示例:
[sql]- --显示备份信息
- [root@rac1 ~]# ocrconfig -showbackup
- rac1 2012/02/20 20:45:32 /u01/crs1020/cdata/crs
- rac1 2012/02/19 16:45:47 /u01/crs1020/cdata/crs
- rac1 2012/02/18 22:18:40 /u01/crs1020/cdata/crs
- rac1 2012/02/19 16:45:47 /u01/crs1020/cdata/crs
- rac1 2012/02/19 16:45:47 /u01/crs1020/cdata/crs
- [root@rac1 ~]# ll /u01/crs1020/cdata/crs/
- total 28296
- -rw-r--r-- 1 root root 4816896 Feb 20 20:45 backup00.ocr
- -rw-r--r-- 1 root root 4816896 Feb 19 16:45 backup01.ocr
- -rw-r--r-- 1 root root 4816896 Feb 18 22:18 backup02.ocr
- -rw-r--r-- 1 root root 4816896 Feb 20 20:45 day_.ocr
- -rw-r--r-- 1 root root 4816896 Feb 19 16:45 day.ocr
- -rw-r--r-- 1 root root 4816896 Feb 19 16:45 week.ocr
- --更改备份位置
- [root@rac1 ~]# ocrconfig -backuploc /oracle/backup/ocr
1. 找到物理备份:
$ ocrconfig –showbackup
2. 检查其内容:
# ocrdump file_name –backupfile
3. 停止所有节点上的 Oracle Clusterware:
# crsctl stop crs
4. 还原 OCR 物理备份:
# ocrconfig –restore <CRS HOME>/cdata/jfv_clus/day.ocr
5. 重新启动所有节点上的 Oracle Clusterware:
# crsctl start crs
6. 检查 OCR 完整性:
$ cluvfy comp ocr -n all
示例: [sql]
- --找到物理备份:
- [root@rac1 ~]# ocrconfig -showbackup
- --检查其内容,dump不成功:
- [root@rac1 crs]# ocrdump -backupfile day.ocr
- PROT-302: Failed to initialize ocrdump
- --停止所有节点上的 Oracle Clusterware:
- [root@rac2 ~]# crsctl stop crs
- [root@rac1 ~]# crsctl stop crs
- --还原 OCR 物理备份:
- [root@rac1 ~]# ocrconfig -restore /u01/crs1020/cdata/crs/backup00.ocr
- --重新启动所有节点上的 Oracle Clusterware:
- [root@rac2 ~]# crsctl start crs
- [root@rac1 ~]# crsctl start crs
- --检查 OCR 完整性:
- RACDB1@rac1 /home/oracle$ cluvfy comp ocr -n all
每天都应将 OCR 自动备份备份到其他存储设备:
– 使用首选备份工具。
在进行重大更改之前和之后应对 OCR 进行逻辑备份:
# ocrconfig –export file name
确保还原与当前系统配置相匹配的 OCR 备份。
|
评论暂时关闭