RAC votedisk和OCR还原

来源:互联网 发布:js div position 编辑:程序博客网 时间:2024/06/06 05:20
---1.执行OCR文件的手动备份[root@rac1 ~]# ocrconfig -manualbackup[root@rac1 ~]# ocrconfig -manualbackuprac1     2016/01/21 19:03:06     /g01/app/11.2.0/grid/cdata/rac-cluster/backup_20160121_190306.ocrrac1     2016/01/21 18:40:18     /g01/app/11.2.0/grid/cdata/rac-cluster/backup_20160121_184018.ocrrac1     2016/01/21 18:13:32     /g01/app/11.2.0/grid/cdata/rac-cluster/backup_20160121_181332.ocr--2.查看OCR的备份[root@rac1 ~]# ocrconfig -showbackup rac1     2016/01/21 18:54:52     /g01/app/11.2.0/grid/cdata/rac-cluster/backup00.ocrrac1     2016/01/21 14:54:49     /g01/app/11.2.0/grid/cdata/rac-cluster/backup01.ocrrac1     2016/01/21 10:54:46     /g01/app/11.2.0/grid/cdata/rac-cluster/backup02.ocrrac1     2016/01/20 02:44:37     /g01/app/11.2.0/grid/cdata/rac-cluster/day.ocrrac1     2016/01/16 20:26:01     /g01/app/11.2.0/grid/cdata/rac-cluster/week.ocrrac1     2016/01/21 19:03:06     /g01/app/11.2.0/grid/cdata/rac-cluster/backup_20160121_190306.ocrrac1     2016/01/21 18:40:18     /g01/app/11.2.0/grid/cdata/rac-cluster/backup_20160121_184018.ocrrac1     2016/01/21 18:13:32     /g01/app/11.2.0/grid/cdata/rac-cluster/backup_20160121_181332.ocr----3.查看votedisk[root@rac1 ~]# crsctl query css votedisk##  STATE    File Universal Id                File Name Disk group--  -----    -----------------                --------- --------- 1. ONLINE   82c35688a9654f47bfc14ebf973821a6 (/dev/asm-diskb) [OCR]Located 1 voting disk(s).---4.停止数据库和群集停库:[root@rac1 ~]# srvctl stop database -d racdb -o immediate [root@rac1 ~]# crsctl status resource -t--------------------------------------------------------------------------------NAME           TARGET  STATE        SERVER                   STATE_DETAILS       --------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.DATA.dg               ONLINE  ONLINE       rac1                                                        ONLINE  ONLINE       rac2                                         ora.FRA.dg               ONLINE  ONLINE       rac1                                                        ONLINE  ONLINE       rac2                                         ora.LISTENER.lsnr               ONLINE  ONLINE       rac1                                                        ONLINE  ONLINE       rac2                                         ora.OCR.dg               ONLINE  ONLINE       rac1                                                        ONLINE  ONLINE       rac2                                         ora.asm               ONLINE  ONLINE       rac1                     Started                            ONLINE  ONLINE       rac2                     Started             ora.gsd               OFFLINE OFFLINE      rac1                                                        OFFLINE OFFLINE      rac2                                         ora.net1.network               ONLINE  ONLINE       rac1                                                        ONLINE  ONLINE       rac2                                         ora.ons               ONLINE  ONLINE       rac1                                                        ONLINE  ONLINE       rac2                                         --------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.LISTENER_SCAN1.lsnr      1        ONLINE  ONLINE       rac1                                         ora.cvu      1        ONLINE  ONLINE       rac1                                         ora.oc4j      1        ONLINE  ONLINE       rac1                                         ora.rac1.vip      1        ONLINE  ONLINE       rac1                                         ora.rac2.vip      1        ONLINE  ONLINE       rac2                                         ora.racdb.db      1        OFFLINE OFFLINE                               Instance Shutdown         2        OFFLINE OFFLINE                               Instance Shutdown   ora.scan1.vip      1        ONLINE  ONLINE       rac1     停集群:[root@rac1 ~]# crsctl stop cluster -all CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac1'CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac1'CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac1'CRS-2673: Attempting to stop 'ora.OCR.dg' on 'rac1'CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac1'CRS-2673: Attempting to stop 'ora.FRA.dg' on 'rac1'CRS-2673: Attempting to stop 'ora.cvu' on 'rac1'CRS-2673: Attempting to stop 'ora.oc4j' on 'rac1'CRS-2677: Stop of 'ora.cvu' on 'rac1' succeededCRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac1'CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.rac1.vip' on 'rac1'CRS-2677: Stop of 'ora.DATA.dg' on 'rac1' succeededCRS-2677: Stop of 'ora.FRA.dg' on 'rac1' succeededCRS-2677: Stop of 'ora.scan1.vip' on 'rac1' succeededCRS-2677: Stop of 'ora.rac1.vip' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.crsd' on 'rac2'CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac2'CRS-2673: Attempting to stop 'ora.OCR.dg' on 'rac2'CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac2'CRS-2673: Attempting to stop 'ora.FRA.dg' on 'rac2'CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac2'CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac2' succeededCRS-2673: Attempting to stop 'ora.rac2.vip' on 'rac2'CRS-2677: Stop of 'ora.DATA.dg' on 'rac2' succeededCRS-2677: Stop of 'ora.FRA.dg' on 'rac2' succeededCRS-2677: Stop of 'ora.rac2.vip' on 'rac2' succeededCRS-2677: Stop of 'ora.OCR.dg' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.asm' on 'rac1'CRS-2677: Stop of 'ora.asm' on 'rac1' succeededCRS-2677: Stop of 'ora.OCR.dg' on 'rac2' succeededCRS-2673: Attempting to stop 'ora.asm' on 'rac2'CRS-2677: Stop of 'ora.asm' on 'rac2' succeededCRS-2673: Attempting to stop 'ora.ons' on 'rac2'CRS-2677: Stop of 'ora.ons' on 'rac2' succeededCRS-2673: Attempting to stop 'ora.net1.network' on 'rac2'CRS-2677: Stop of 'ora.net1.network' on 'rac2' succeededCRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac2' has completedCRS-2677: Stop of 'ora.crsd' on 'rac2' succeededCRS-2673: Attempting to stop 'ora.ctssd' on 'rac2'CRS-2673: Attempting to stop 'ora.evmd' on 'rac2'CRS-2673: Attempting to stop 'ora.asm' on 'rac2'CRS-2677: Stop of 'ora.evmd' on 'rac2' succeededCRS-2677: Stop of 'ora.oc4j' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.ons' on 'rac1'CRS-2677: Stop of 'ora.ons' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.net1.network' on 'rac1'CRS-2677: Stop of 'ora.net1.network' on 'rac1' succeededCRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac1' has completedCRS-2677: Stop of 'ora.crsd' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'CRS-2673: Attempting to stop 'ora.evmd' on 'rac1'CRS-2673: Attempting to stop 'ora.asm' on 'rac1'CRS-2677: Stop of 'ora.ctssd' on 'rac2' succeededCRS-2677: Stop of 'ora.ctssd' on 'rac1' succeededCRS-2677: Stop of 'ora.evmd' on 'rac1' succeededCRS-2677: Stop of 'ora.asm' on 'rac2' succeededCRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac2'CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac2' succeededCRS-2673: Attempting to stop 'ora.cssd' on 'rac2'CRS-2677: Stop of 'ora.cssd' on 'rac2' succeededCRS-2677: Stop of 'ora.asm' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1'CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.cssd' on 'rac1'CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded[root@rac1 ~]#  crsctl check crsCRS-4638: Oracle High Availability Services is onlineCRS-4535: Cannot communicate with Cluster Ready ServicesCRS-4530: Communications failure contacting Cluster Synchronization Services daemonCRS-4534: Cannot communicate with Event Manager[root@rac1 ~]# crsctl stop crsCRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1'CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'CRS-2673: Attempting to stop 'ora.crf' on 'rac1'CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeededCRS-2677: Stop of 'ora.crf' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeededCRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completedCRS-4133: Oracle High Availability Services has been stopped.[root@rac1 ~]# crsctl status resource -tCRS-4535: Cannot communicate with Cluster Ready ServicesCRS-4000: Command Status failed, or completed with errors.--5.破坏表决磁盘和OCR[root@rac1 ~]# dd if=/dev/zero of=/dev/asm-diskb bs=1024k count=11+0 records in1+0 records out1048576 bytes (1.0 MB) copied, 0.0371992 s, 28.2 MB/s---6.启动crs查看错误[root@rac1 ~]# crsctl start cluster -all  CRS-4639: Could not contact Oracle High Availability ServicesCRS-4000: Command Start failed, or completed with errors.[root@rac1 ~]#  crsctl start cluster -all  CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac2'CRS-2676: Start of 'ora.cssdmonitor' on 'rac2' succeededCRS-2672: Attempting to start 'ora.cssd' on 'rac2'CRS-2672: Attempting to start 'ora.diskmon' on 'rac2'CRS-2676: Start of 'ora.diskmon' on 'rac2' succeeded  --停在这里---7.停止crs[root@rac1 bin]# ./crsctl stop crs -fCRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1'CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.crf' on 'rac1'CRS-2677: Stop of 'ora.crf' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeededCRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completedCRS-4133: Oracle High Availability Services has been stopped.----8.以独占模式启动crs[root@rac1 ~]# crsctl start crs -excl -nocrsCRS-4123: Oracle High Availability Services has been started.CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeededCRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeededCRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeededCRS-2676: Start of 'ora.gipcd' on 'rac1' succeededCRS-2672: Attempting to start 'ora.cssd' on 'rac1'CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'CRS-2676: Start of 'ora.diskmon' on 'rac1' succeededCRS-2676: Start of 'ora.cssd' on 'rac1' succeededCRS-2679: Attempting to clean 'ora.cluster_interconnect.haip' on 'rac1'CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'CRS-2681: Clean of 'ora.cluster_interconnect.haip' on 'rac1' succeededCRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rac1'CRS-2676: Start of 'ora.ctssd' on 'rac1' succeededCRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rac1' succeededCRS-2672: Attempting to start 'ora.asm' on 'rac1'CRS-2676: Start of 'ora.asm' on 'rac1' succeeded[root@rac1 ~]# crsctl query css votediskLocated 0 voting disk(s).--9.重建原ocr和votedisk所在磁盘组sqlplus / as sysasmcol path for a50set lines 300select path,header_status from v$asm_disk; PATH                           HEADER_STATUS-------------------------------------------------- ------------------------------------/dev/asm-diskb                       CANDIDATE/dev/asm-diskc                       MEMBER/dev/asm-diskd                       MEMBERcreate diskgroup OCRexternal redundancydisk '/dev/asm-diskb' attribute 'compatible.rdbms' = '11.2','compatible.asm' = '11.2';SQL> select path,header_status from v$asm_disk; PATH                           HEADER_STATUS-------------------------------------------------- ------------------------------------/dev/asm-diskd                       MEMBER/dev/asm-diskc                       MEMBER/dev/asm-diskb                       MEMBERASMCMD> lsdgState    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  NameMOUNTED  EXTERN  N         512   4096  1048576      2016     1966                0            1966              0             N  OCR/SQL> show parameter asm_diskstring如果asm_diskstring没有值,表示ASM磁盘用的是默认ASM磁盘搜索路径。修改成实际的ASM磁盘搜索路径:SQL> alter system set asm_diskstring='/dev/*';手动加载diskgroupSQL> alter diskgroup data mount;Diskgroup altered.SQL> alter diskgroup fra mount;Diskgroup altered.ASMCMD> lsdgState    Type    Rebal  Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  NameMOUNTED  EXTERN  N         512   4096  1048576     40000    37339                0           37339              0             N  DATA/MOUNTED  EXTERN  N         512   4096  1048576     30016    29686                0           29686              0             N  FRA/MOUNTED  EXTERN  N         512   4096  1048576      2016     1966                0            1966              0             N  OCR/----10.恢复VOTEDISK和OCR---查看备份[root@rac1 ~]# ls -al /g01/app/11.2.0/grid/cdata/rac-cluster/total 63672drwxrwxr-x 2 grid oinstall    4096 Jan 21 19:03 .drwxrwxr-x 5 grid oinstall    4096 Jan 16 16:06 ..-rw------- 1 root root     7315456 Jan 21 18:54 backup00.ocr-rw------- 1 root root     7266304 Jan 21 14:54 backup01.ocr-rw------- 1 root root     7266304 Jan 21 10:54 backup02.ocr-rw------- 1 root root     7266304 Jan 21 18:13 backup_20160121_181332.ocr-rw------- 1 root root     7294976 Jan 21 18:40 backup_20160121_184018.ocr-rw------- 1 root root     7315456 Jan 21 19:03 backup_20160121_190306.ocr-rw------- 1 root root     7266304 Jan 21 02:54 day_.ocr-rw------- 1 root root     7266304 Jan 20 02:44 day.ocr-rw------- 1 root root     6934528 Jan 16 20:26 week.ocr[root@rac1 ~]# ocrconfig -showbackupPROT-26: Oracle Cluster Registry backup locations were retrieved from a local copyrac1     2016/01/21 18:54:52     /g01/app/11.2.0/grid/cdata/rac-cluster/backup00.ocrrac1     2016/01/21 14:54:49     /g01/app/11.2.0/grid/cdata/rac-cluster/backup01.ocrrac1     2016/01/21 10:54:46     /g01/app/11.2.0/grid/cdata/rac-cluster/backup02.ocrrac1     2016/01/20 02:44:37     /g01/app/11.2.0/grid/cdata/rac-cluster/day.ocrrac1     2016/01/16 20:26:01     /g01/app/11.2.0/grid/cdata/rac-cluster/week.ocrrac1     2016/01/21 18:40:18     /g01/app/11.2.0/grid/cdata/rac-cluster/backup_20160121_184018.ocrrac1     2016/01/21 18:13:32     /g01/app/11.2.0/grid/cdata/rac-cluster/backup_20160121_181332.ocr[root@rac1 ~]# ocrconfig -showbackup manualPROT-26: Oracle Cluster Registry backup locations were retrieved from a local copyrac1     2016/01/21 18:40:18     /g01/app/11.2.0/grid/cdata/rac-cluster/backup_20160121_184018.ocrrac1     2016/01/21 18:13:32     /g01/app/11.2.0/grid/cdata/rac-cluster/backup_20160121_181332.ocr#ocrconfig -restore  /g01/app/11.2.0/grid/cdata/rac-cluster/backup00.ocr[root@rac1 ~]# crsctl replace votedisk  +OCRSuccessful addition of voting disk 75b8db60ea4b4fefbf783d9b81527150.Successfully replaced voting disk group with +OCR.CRS-4266: Voting file(s) successfully replaced[root@rac1 ~]# crsctl query css votedisk##  STATE    File Universal Id                File Name Disk group--  -----    -----------------                --------- --------- 1. ONLINE   75b8db60ea4b4fefbf783d9b81527150 (/dev/asm-diskb) [OCR]Located 1 voting disk(s).----11.停止CRS[root@rac1 ~]# crsctl stop  crs -fCRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1'CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'CRS-2673: Attempting to stop 'ora.asm' on 'rac1'CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeededCRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeededCRS-2677: Stop of 'ora.asm' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1'CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.cssd' on 'rac1'CRS-2677: Stop of 'ora.cssd' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeededCRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeededCRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completedCRS-4133: Oracle High Availability Services has been stopped.---12.正常启动crs[root@rac1 ~]# crsctl start crsCRS-4123: Oracle High Availability Services has been started.[root@rac1 ~]# crsctl check crsCRS-4638: Oracle High Availability Services is onlineCRS-4535: Cannot communicate with Cluster Ready ServicesCRS-4529: Cluster Synchronization Services is onlineCRS-4533: Event Manager is online[root@rac1 ~]# crsctl status resource -t--------------------------------------------------------------------------------NAME           TARGET  STATE        SERVER                   STATE_DETAILS       --------------------------------------------------------------------------------Local Resources--------------------------------------------------------------------------------ora.DATA.dg               ONLINE  ONLINE       rac1                                                        ONLINE  ONLINE       rac2                                         ora.FRA.dg               ONLINE  ONLINE       rac1                                                        ONLINE  ONLINE       rac2                                         ora.LISTENER.lsnr               ONLINE  ONLINE       rac1                                                        ONLINE  ONLINE       rac2                                         ora.OCR.dg               ONLINE  ONLINE       rac1                                                        ONLINE  ONLINE       rac2                                         ora.asm               ONLINE  ONLINE       rac1                     Started                            ONLINE  ONLINE       rac2                     Started             ora.gsd               OFFLINE OFFLINE      rac1                                                        OFFLINE OFFLINE      rac2                                         ora.net1.network               ONLINE  ONLINE       rac1                                                        ONLINE  ONLINE       rac2                                         ora.ons               ONLINE  ONLINE       rac1                                                        ONLINE  ONLINE       rac2                                         --------------------------------------------------------------------------------Cluster Resources--------------------------------------------------------------------------------ora.LISTENER_SCAN1.lsnr      1        ONLINE  ONLINE       rac1                                         ora.cvu      1        ONLINE  ONLINE       rac1                                         ora.oc4j      1        ONLINE  ONLINE       rac1                                         ora.rac1.vip      1        ONLINE  ONLINE       rac1                                         ora.rac2.vip      1        ONLINE  ONLINE       rac2                                         ora.racdb.db      1        ONLINE  ONLINE       rac1                     Open                      2        ONLINE  ONLINE       rac2                     Open                ora.scan1.vip      1        ONLINE  ONLINE       rac1                                         

1 0
原创粉丝点击