首页 > 数据库 > Oracle > 备份和还原OCR文件
1. 执行以下命令显示备份文件列表信息:
[root@vmac1 ~]# ocrconfig -showbackup
vmac1 2015/02/07 03:48:12 /g01/11ggrid/app/11.2.0/grid/cdata/vmac-cluster/backup00.ocr
vmac1 2015/01/17 21:28:20 /g01/11ggrid/app/11.2.0/grid/cdata/vmac-cluster/backup01.ocr
vmac1 2015/01/17 17:28:13 /g01/11ggrid/app/11.2.0/grid/cdata/vmac-cluster/backup02.ocr
vmac1 2015/02/07 03:48:12 /g01/11ggrid/app/11.2.0/grid/cdata/vmac-cluster/day.ocr
vmac1 2015/02/07 03:48:12 /g01/11ggrid/app/11.2.0/grid/cdata/vmac-cluster/week.ocr
PROT-25: Manual backups for the Oracle Cluster Registry are not available
2. 改变OCR备份文件的位置:
[root@vmac1 ~]# ocrconfig -backuploc /g01/11ggrid/app/11.2.0/grid/cdata/
3. 还原OCR
执行以下命令验证OCR是否损坏:
[root@vmac1 ~]# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2908
Available space (kbytes) : 259212
ID : 201121049
Device/File Name : +SYSTETDG
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check succeeded
[root@vmac1 ~]# olsnodes
vmac1
vmac2
[root@vmac1 ~]# crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'vmac1'
CRS-2673: Attempting to stop 'ora.crsd' on 'vmac1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'vmac1'
CRS-2673: Attempting to stop 'ora.cvu' on 'vmac1'
CRS-2673: Attempting to stop 'ora.oc4j' on 'vmac1'
CRS-2673: Attempting to stop 'ora.vmac2.vip' on 'vmac1'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'vmac1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'vmac1'
CRS-2673: Attempting to stop 'ora.SYSTEDG.dg' on 'vmac1'
CRS-2673: Attempting to stop 'ora.ffei.db' on 'vmac1'
CRS-2677: Stop of 'ora.cvu' on 'vmac1' succeeded
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'vmac1' succeeded
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'vmac1' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'vmac1'
CRS-2677: Stop of 'ora.vmac2.vip' on 'vmac1' succeeded
CRS-2673: Attempting to stop 'ora.vmac1.vip' on 'vmac1'
CRS-2677: Stop of 'ora.SYSTEDG.dg' on 'vmac1' succeeded
CRS-2677: Stop of 'ora.scan1.vip' on 'vmac1' succeeded
CRS-2677: Stop of 'ora.ffei.db' on 'vmac1' succeeded
CRS-2673: Attempting to stop 'ora.SYSTETDG.dg' on 'vmac1'
CRS-2677: Stop of 'ora.vmac1.vip' on 'vmac1' succeeded
CRS-2677: Stop of 'ora.SYSTETDG.dg' on 'vmac1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'vmac1'
CRS-2677: Stop of 'ora.asm' on 'vmac1' succeeded
CRS-2677: Stop of 'ora.oc4j' on 'vmac1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'vmac1'
CRS-2677: Stop of 'ora.ons' on 'vmac1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'vmac1'
CRS-2677: Stop of 'ora.net1.network' on 'vmac1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'vmac1' has completed
CRS-2677: Stop of 'ora.crsd' on 'vmac1' succeeded
CRS-2673: Attempting to stop 'ora.crf' on 'vmac1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'vmac1'
CRS-2673: Attempting to stop 'ora.evmd' on 'vmac1'
CRS-2673: Attempting to stop 'ora.asm' on 'vmac1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'vmac1'
CRS-2677: Stop of 'ora.crf' on 'vmac1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'vmac1' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'vmac1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'vmac1' succeeded
CRS-2677: Stop of 'ora.asm' on 'vmac1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'vmac1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'vmac1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'vmac1'
CRS-2677: Stop of 'ora.cssd' on 'vmac1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'vmac1'
CRS-2677: Stop of 'ora.gipcd' on 'vmac1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'vmac1'
CRS-2677: Stop of 'ora.gpnpd' on 'vmac1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'vmac1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[root@vmac1 ~]# crsctl start crs -excl
CRS-4123: Oracle High Availability Services has been started.
CRS-5702: Resource 'ora.cssd' is already running on 'vmac1'
CRS-4000: Command Start failed, or completed with errors.
[root@vmac1 ~]# ocrconfig -restore +SYSTETDG
PROT-19: Cannot proceed while the Cluster Ready Service is running
[root@vmac1 ~]# crsctl stop resource ora.crsd -init
CRS-2673: Attempting to stop 'ora.crsd' on 'vmac1'
CRS-2677: Stop of 'ora.crsd' on 'vmac1' succeeded
[root@vmac1 ~]# ocrconfig -restore +SYSTETDG
PROT-18: Failed to open the specified backup file '+SYSTETDG'
[root@vmac1 ~]# ocrconfig -manualbackup
vmac1 2015/03/21 02:38:22 /g01/11ggrid/app/11.2.0/grid/cdata/vmac-cluster/backup_20150321_023822.ocr
[root@vmac1 ~]# crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 5a0019edc0fe4f75bf9ff6ff897522ba (/dev/asm-diskg) [SYSTETDG]
2. ONLINE 00694e2129a84f88bf2b21ca5d48d6ac (/dev/asm-diskf) [SYSTETDG]
Located 2 voting disk(s).
[root@vmac1 ~]# dd /dev/zero of=/dev/asm-diskg
dd: unrecognized operand `/dev/zero'
Try `dd --help' for more information.
[root@vmac1 ~]# dd if=/dev/zero of=/dev/asm-diskg
^C187329+0 records in
187329+0 records out
95912448 bytes (96 MB) copied, 9.40374 s, 10.2 MB/s
[root@vmac1 ~]# dd if=/dev/zero of=/dev/asm-diskf count=256
256+0 records in
256+0 records out
131072 bytes (131 kB) copied, 0.080165 s, 1.6 MB/s
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29313086/viewspace-1468509/ ,如需转载,请注明出处,否则将追究法律责任。