OCR自动备份
显示OCR自动备份,默认情况下每4个小时会自动备份一次,并保留三个有效版本,不过虚拟机环境有可能会出现以下情况
1 2 3 4 |
[root@rac1 ~]# ocrconfig -showbackup PROT-24: Auto backups for the Oracle Cluster Registry are not available PROT-25: Manual backups for the Oracle Cluster Registry are not available [root@rac1 ~]# |
原因是:每4个小时会自动备份一次,这个4个小时需要连续开机达到4个小时,才自动备份(需要注意的是,备份信息只保留在一个节点上)
当连续开机达到4个小时,再次显示备份信息
1 2 3 4 5 6 7 8 9 |
[root@rac2 ~]# ocrconfig -showbackup rac1 2014/02/07 14:47:21 /u01/app/11.2.0/grid/cdata/rac-cluster/backup00.ocr rac1 2014/02/07 14:47:21 /u01/app/11.2.0/grid/cdata/rac-cluster/day.ocr rac1 2014/02/07 14:47:21 /u01/app/11.2.0/grid/cdata/rac-cluster/week.ocr PROT-25: Manual backups for the Oracle Cluster Registry are not available [root@rac2 ~]# |
我们还看到了PROT-25: Manual backups for the Oracle Cluster Registry are not available
原因是,在showbackup时显示的是自动和手动的备份,我们只有自动备份,没有手动备份过,所以有此信息。
手工备份命令如下:
1 2 3 4 5 |
[root@rac1 ~]# ocrconfig -manualbackup rac1 2014/02/07 15:05:16 /u01/app/11.2.0/grid/cdata/rac-cluster/backup_20140207_150516.ocr [root@rac1 ~]# |
再次查看OCR备份信息
1 2 3 4 5 6 7 8 9 10 |
[root@rac1 ~]# ocrconfig -showbackup rac1 2014/02/07 14:47:21 /u01/app/11.2.0/grid/cdata/rac-cluster/backup00.ocr rac1 2014/02/07 14:47:21 /u01/app/11.2.0/grid/cdata/rac-cluster/day.ocr rac1 2014/02/07 14:47:21 /u01/app/11.2.0/grid/cdata/rac-cluster/week.ocr rac1 2014/02/07 15:05:16 /u01/app/11.2.0/grid/cdata/rac-cluster/backup_20140207_150516.ocr [root@rac1 ~]# |
ocrconfig语法:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
[root@rac1 ~]# ocrconfig Name: ocrconfig - Configuration tool for Oracle Cluster/Local Registry. Synopsis: ocrconfig [option] option: [-local] -export <filename> - Export OCR/OLR contents to a file [-local] -import <filename> - Import OCR/OLR contents from a file [-local] -upgrade [<user> [<group>]] - Upgrade OCR from previous version -downgrade [-version <version string>] - Downgrade OCR to the specified version [-local] -backuploc <dirname> - Configure OCR/OLR backup location [-local] -showbackup [auto|manual] - Show OCR/OLR backup information [-local] -manualbackup - Perform OCR/OLR backup [-local] -restore <filename> - Restore OCR/OLR from physical backup -replace <current filename> -replacement <new filename> - Replace a OCR device/file <filename1> with <filename2> -add <filename> - Add a new OCR device/file -delete <filename> - Remove a OCR device/file -overwrite - Overwrite OCR configuration on disk -repair -add <filename> | -delete <filename> | -replace <current filename> -replacement <new filename> - Repair OCR configuration on the local node -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. * Only -local -showbackup [manual] is supported. * Use option '-local' to indicate that the operation is to be performed on the Oracle Local Registry. [root@rac1 ~]# |
测试环境:OEL5.6_64+oracle11g R2 RAC 11.2.0.2.0