Oracle RAC OCR备份恢复

一、OCR物理备份恢复

1、手动备份OCR

[root@lissen-node1 ocr]# ocrconfig -showbackup;
PROT-24: Auto backups for the Oracle Cluster Registry are not available

lissen-node1     2020/02/25 22:46:34     +OCR:/lissen/OCRBACKUP/backup_20200225_224634.ocr.262.1033339595     0     

lissen-node1     2020/02/25 22:34:52     +OCR:/lissen/OCRBACKUP/backup_20200225_223452.ocr.261.1033338893     0     

lissen-node1     2020/02/25 21:05:47     +OCR:/lissen/OCRBACKUP/backup_20200225_210547.ocr.260.1033333551     0     

lissen-node1     2020/02/25 21:03:16     +OCR:/lissen/OCRBACKUP/backup_20200225_210316.ocr.259.1033333397     0     

lissen-node1     2020/02/25 21:01:35     +OCR:/lissen/OCRBACKUP/backup_20200225_210135.ocr.258.1033333297     0     
[root@lissen-node1 ocr]# ocrconfig -manualbackup;

lissen-node1     2020/02/25 23:07:51     +OCR:/lissen/OCRBACKUP/backup_20200225_230751.ocr.263.1033340873     0     

lissen-node1     2020/02/25 22:46:34     +OCR:/lissen/OCRBACKUP/backup_20200225_224634.ocr.262.1033339595     0     

lissen-node1     2020/02/25 22:34:52     +OCR:/lissen/OCRBACKUP/backup_20200225_223452.ocr.261.1033338893     0     

lissen-node1     2020/02/25 21:05:47     +OCR:/lissen/OCRBACKUP/backup_20200225_210547.ocr.260.1033333551     0     

lissen-node1     2020/02/25 21:03:16     +OCR:/lissen/OCRBACKUP/backup_20200225_210316.ocr.259.1033333397     

2、检验OCR组件的完整性

[grid@lissen-node1 ~]$ cluvfy comp ocr -n all -verbose;

Verifying OCR Integrity ...PASSED

Verification of OCR integrity was successful. 

CVU operation performed:      OCR integrity
Date:                         Feb 25, 2020 11:11:02 PM
CVU home:                     /u19/app/19.2.0.0.0/grid/
User:                         grid

3、关闭CRS

crsctl stop crs -f

4、以nocrs排他模式启动CRS(一个节点)

节点1:
[root@lissen-node1 ocr]# crsctl start crs -nocrs -excl
CRS-4123: Oracle High Availability Services has been started.
CRS-2672: Attempting to start 'ora.evmd' on 'lissen-node1'
CRS-2672: Attempting to start 'ora.mdnsd' on 'lissen-node1'
CRS-2676: Start of 'ora.evmd' on 'lissen-node1' succeeded
CRS-2676: Start of 'ora.mdnsd' on 'lissen-node1' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'lissen-node1'
CRS-2676: Start of 'ora.gpnpd' on 'lissen-node1' succeeded
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'lissen-node1'
CRS-2672: Attempting to start 'ora.gipcd' on 'lissen-node1'
CRS-2676: Start of 'ora.cssdmonitor' on 'lissen-node1' succeeded
CRS-2676: Start of 'ora.gipcd' on 'lissen-node1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'lissen-node1'
CRS-2672: Attempting to start 'ora.diskmon' on 'lissen-node1'
CRS-2676: Start of 'ora.diskmon' on 'lissen-node1' succeeded
CRS-2676: Start of 'ora.cssd' on 'lissen-node1' succeeded
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'lissen-node1'
CRS-2672: Attempting to start 'ora.ctssd' on 'lissen-node1'
CRS-2676: Start of 'ora.ctssd' on 'lissen-node1' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'lissen-node1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'lissen-node1'
CRS-2676: Start of 'ora.asm' on 'lissen-node1' succeeded

5、还原OCR

[root@lissen-node1 ocr]# ocrconfig -showbackup;
PROT-24: Auto backups for the Oracle Cluster Registry are not available

lissen-node1     2020/02/25 23:07:51     +OCR:/lissen/OCRBACKUP/backup_20200225_230751.ocr.263.1033340873     0     

lissen-node1     2020/02/25 22:46:34     +OCR:/lissen/OCRBACKUP/backup_20200225_224634.ocr.262.1033339595     0     

lissen-node1     2020/02/25 22:34:52     +OCR:/lissen/OCRBACKUP/backup_20200225_223452.ocr.261.1033338893     0     

lissen-node1     2020/02/25 21:05:47     +OCR:/lissen/OCRBACKUP/backup_20200225_210547.ocr.260.1033333551     0     

lissen-node1     2020/02/25 21:03:16     +OCR:/lissen/OCRBACKUP/backup_20200225_210316.ocr.259.1033333397     0     

[root@lissen-node1 ocr]# ocrconfig -restore '+OCR/lissen/OCRBACKUP/backup_20200225_230751.ocr.263.1033340873';

6、重启CRS后检查OCR是否恢复成功

节点1:
[root@lissen-node1 ocr]# crsctl stop crs -f
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'lissen-node1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'lissen-node1'
CRS-2673: Attempting to stop 'ora.evmd' on 'lissen-node1'
CRS-2673: Attempting to stop 'ora.asm' on 'lissen-node1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'lissen-node1'
CRS-2677: Stop of 'ora.ctssd' on 'lissen-node1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'lissen-node1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'lissen-node1' succeeded
CRS-2677: Stop of 'ora.asm' on 'lissen-node1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'lissen-node1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'lissen-node1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'lissen-node1'
CRS-2677: Stop of 'ora.cssd' on 'lissen-node1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'lissen-node1'
CRS-2673: Attempting to stop 'ora.gipcd' on 'lissen-node1'
CRS-2677: Stop of 'ora.gpnpd' on 'lissen-node1' succeeded
CRS-2677: Stop of 'ora.gipcd' on 'lissen-node1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'lissen-node1' has completed
CRS-4133: Oracle High Availability Services has been stopped.

节点1和节点2:

crsctl start crs

校验OCR

[grid@lissen-node1 ~]$ cluvfy comp ocr -verbose;

Verifying OCR Integrity ...PASSED

Verification of OCR integrity was successful. 

CVU operation performed:      OCR integrity
Date:                         Feb 25, 2020 11:24:37 PM
CVU home:                     /u19/app/19.2.0.0.0/grid/
User:                         grid

二、OCR逻辑备份恢复

OCR逻辑备份恢复和物理备份恢复步骤差不多,逻辑备份恢复命令如下:

[root@lissen-node1 ocr]# ocrconfig -export "/u19/app/grid/crsdata/lissen-node1/ocr/lgc_$(date +%Y-%m-%d_%H:%M:%S).ocr";
PROT-58: successfully exported the Oracle Cluster Registry contents to file '/u19/app/grid/crsdata/lissen-node1/ocr/lgc_2020-02-25_23:28:41.ocr'
[root@lissen-node1 ocr]# ls -l /u19/app/grid/crsdata/lissen-node1/ocr
total 204
-rw------- 1 root root 208896 Feb 25 23:28 lgc_2020-02-25_23:28:41.ocr

[root@lissen-node1 ocr]# ocrconfig -import /u19/app/grid/crsdata/lissen-node1/ocr/lgc_2020-02-25_23:28:41.ocr
Oracle RAC OCR备份恢复Oracle RAC OCR备份恢复 Lissen_Gan 发布了25 篇原创文章 · 获赞 26 · 访问量 4333 私信 关注
上一篇:CRS曲线拟合:centripetal Catmull-Rom spline


下一篇:ABP开发手记4 - 初始化运行