李波Joker 发表于 2016-4-14 11:25:50

11GR2 OCR&VOTING DISK REDULID WITH BACKUP

查看votedisk信息
# ./crsctl query css votedisk
##STATE    File Universal Id                File Name Disk group
-------    -----------------                --------- ---------
1. ONLINE   649b109da77a4f0cbf4b922be1b44312 (ORCL:VOL1)
Located 1 voting disk(s).

查看OCR信息
# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version                  :          3
Total space (kbytes)   :   262120
Used space (kbytes)      :       3212
Available space (kbytes) :   258908
ID                     : 2126600233
Device/File Name         :    +GRIDDG
                                    Device/File integrity check succeeded
Device/File Name         : +OCR_VOTE_BAK
                                    Device/File integrity check succeeded


                                    Device/File not configured


                                    Device/File not configured


                                    Device/File not configured


Cluster registry integrity check succeeded


Logical corruption check succeeded

停止两个节点的CRS
# ./crsctl stop crs
# ./crsctl stop crs

破坏磁盘组+GRIDDG所在磁盘的磁盘头信息
# dd if=/dev/zero of=/dev/sdb bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.009277 seconds, 113 MB/s
# dd if=/dev/zero of=/dev/sdc bs=1M count=1
1+0 records in
1+0 records out
1048576 bytes (1.0 MB) copied, 0.005399 seconds, 194 MB/s



尝试启动CRS
# ./crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

alertrac1.log告警日记报如下错误:
CRS-1714:Unable to discover any voting files, retrying discovery in 15 seconds; Details at (:CSSNM00070:) in /u01/app/11.2.0/grid/log/rac1/cssd/ocssd.log
06:36:54.759:
CRS-1714:Unable to discover any voting files, retrying discovery in 15 seconds; Details at (:CSSNM00070:) in /u01/app/11.2.0/grid/log/rac1/cssd/ocssd.log
06:37:09.775:
CRS-1714:Unable to discover any voting files, retrying discovery in 15 seconds; Details at (:CSSNM00070:) in /u01/app/11.2.0/grid/log/rac1/cssd/ocssd.log
06:37:24.787:
CRS-1714:Unable to discover any voting files, retrying discovery in 15 seconds; Details at (:CSSNM00070:) in /u01/app/11.2.0/grid/log/rac1/cssd/ocssd.log



ocssd.log告警日记内容如下:
06:37:39.798: [   SKGFD]Discovery with asmlib :ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so: str ::

06:37:39.799: [   SKGFD]Fetching asmlib disk :ORCL:VOL1:
06:37:39.799: [   SKGFD]Fetching asmlib disk :ORCL:VOL2:
06:37:39.799: [   SKGFD]Fetching asmlib disk :ORCL:VOL4:
06:37:39.799: [   SKGFD]Fetching asmlib disk :ORCL:VOL5:
06:37:39.799: [   SKGFD]Handle 0x18a420d0 from lib :ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so: for disk :ORCL:VOL2:
06:37:39.799: [   SKGFD]Handle 0x18a431a0 from lib :ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so: for disk :ORCL:VOL3:
06:37:39.799: [   SKGFD]Handle 0x189e9b90 from lib :ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so: for disk :ORCL:VOL4:
06:37:39.799: [   SKGFD]Handle 0x189ea3c0 from lib :ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so: for disk :ORCL:VOL5:


06:37:39.799: [   SKGFD]Lib :ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so: closing handle 0x189f6080 for disk :ORCL:VOL1:

06:37:39.800: [   SKGFD]Lib :ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so: closing handle 0x18a420d0 for disk :ORCL:VOL2:


06:37:39.800: [   SKGFD]Lib :ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so: closing handle 0x18a431a0 for disk :ORCL:VOL3:


06:37:39.801: [   SKGFD]Lib :ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so: closing handle 0x189e9b90 for disk :ORCL:VOL4:


06:37:39.801: [   SKGFD]Lib :ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so: closing handle 0x189ea3c0 for disk :ORCL:VOL5:
06:37:39.801: [    CSSD]clssnmvDiskVerify: Successful discovery of 0 disks
06:37:39.801: [    CSSD]clssnmCompleteInitVFDiscovery: Completing initial voting file discovery
06:37:39.801: [    CSSD]clssnmvFindInitialConfigs: No voting files found
06:37:39.801: [    CSSD](:CSSNM00070:)clssnmCompleteInitVFDiscovery: Voting file not found. Retrying discovery in 15 seconds


强行停止CRS
# ./crsctl stop crs -f
CRS-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' succeeded
CRS-2677: Stop of 'ora.crf' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'
CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'
CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed
CRS-4133: Oracle High Availability Services has been stopped.
You have new mail in /var/spool/mail/root

上面停止CRS的过程有点慢,打开另外一个窗口,强行关闭CRS
# /u01/app/11.2.0/grid/bin/crsctl stop crs -f
CRS-2797: Shutdown is already in progress for 'rac1', waiting for it to complete
CRS-2797: Shutdown is already in progress for 'rac1', waiting for it to complete
CRS-4133: Oracle High Availability Services has been stopped.


以排他方式启动,只启动asm,不启动crs
# ./crsctl start crs -excl -nocrs
CRS-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' succeeded
CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'
CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded
CRS-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' succeeded
CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded
CRS-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' succeeded
CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.drivers.acfs' on 'rac1'
CRS-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' succeeded
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'rac1'
CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded
CRS-2676: Start of 'ora.drivers.acfs' on 'rac1' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'rac1'
CRS-2676: Start of 'ora.asm' on 'rac1' succeede


创建OCR和votedisk磁盘组GRIDDG

SQL> create diskgroup GRIDDG external redundancy disk 'ORCL:VOL1','ORCL:VOL2' attribute 'compatible.asm'='11.2','compatible.rdbms'='11.2';

利用备份还原OCR
# ./ocrconfig -restore /u01/app/11.2.0/grid/cdata/scan-cluster/backup_0922_060338.ocr
查看OCR
# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version                  :          3
Total space (kbytes)   :   262120
Used space (kbytes)      :       3192
Available space (kbytes) :   258928
ID                     : 2126600233
Device/File Name         :    +GRIDDG
                                    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

还原votedisk
# ./crsctl replace votedisk +GRIDDG
Successful addition of voting disk 552cc5ad9b064f81bf047faee44bbcdf.
Successfully replaced voting disk group with +GRIDDG.
CRS-4266: Voting file(s) successfully replaced

查看votedisk
# ./crsctl query css votedisk
##STATE    File Universal Id                File Name Disk group
-------    -----------------                --------- ---------
1. ONLINE   552cc5ad9b064f81bf047faee44bbcdf (ORCL:VOL1)
Located 1 voting disk(s).

强行关闭CRS
# ./crsctl stop crs -f
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1'
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'
CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac1'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'
CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'rac1' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac1'
CRS-2677: Stop of 'ora.drivers.acfs' on 'rac1' succeeded
CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'
CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'
CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed
CRS-4133: Oracle High Availability Services has been stopped.

重新启动CRS
# ./crsctl start crs
CRS-4123: Oracle High Availability Services has been started.


已经可以查看集群资源
$ crs_stat -t
Name         Type         Target    State   Host      
------------------------------------------------------------
ora.DATADG.dgora....up.type ONLINE    ONLINE    rac1      
ora.FLASHDG.dg ora....up.type ONLINE    ONLINE    rac1      
ora.GRIDDG.dgora....up.type ONLINE    ONLINE    rac1      
ora....ER.lsnr ora....er.type ONLINE    ONLINE    rac1      
ora....N1.lsnr ora....er.type ONLINE    ONLINE    rac1                  
ora.asm      ora.asm.type   ONLINE    ONLINE    rac1      
ora.cvu      ora.cvu.type   ONLINE    ONLINE    rac1      
ora.devdb.db   ora....se.type ONLINE    ONLINE    rac1      
ora.gsd      ora.gsd.type   OFFLINE   OFFLINE               
ora....network ora....rk.type ONLINE    ONLINE    rac1      
ora.oc4j       ora.oc4j.typeONLINE    ONLINE    rac1      
ora.ons      ora.ons.type   ONLINE    ONLINE    rac1      
ora....SM1.asm application    ONLINE    ONLINE    rac1      
ora....C1.lsnr application    ONLINE    ONLINE    rac1      
ora.rac1.gsd   application    OFFLINE   OFFLINE               
ora.rac1.ons   application    ONLINE    ONLINE    rac1      
ora.rac1.vip   ora....t1.type ONLINE    ONLINE    rac1      
ora....SM2.asm application    ONLINE    ONLINE    rac2      
ora....C2.lsnr application    ONLINE    ONLINE    rac2      
ora.rac2.gsd   application    OFFLINE   OFFLINE               
ora.rac2.ons   application    ONLINE    ONLINE    rac2      
ora.rac2.vip   ora....t1.type ONLINE    ONLINE    rac2      
ora....ry.acfs ora....fs.type ONLINE    ONLINE    rac1      
ora.scan1.vipora....ip.type ONLINE    ONLINE    rac1
页: [1]
查看完整版本: 11GR2 OCR&VOTING DISK REDULID WITH BACKUP