Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method for RAC11G to recover OCR?

2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

The main content of this article is to explain "what is the method for RAC11G to restore OCR". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what is the method of restoring OCR by RAC11G"?

1. Check ocr

[root@rac1 ~] # ocrcheck

Status of Oracle Cluster Registry is as follows:

Version: 3

Total space (kbytes): 262120

Used space (kbytes): 3232

Available space (kbytes): 258888

ID: 811139123

Device/File Name: + ocr

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

two。 Check votedisk

[root@rac2 ~] # crsctl query css votedisk

# # STATE File Universal Id File Name Disk group

1. ONLINE 4b031d63f88f4f0cbf5cc8688884d5f2 (/ dev/asm-diskb) [OCR]

2. ONLINE 1acaf51067b94fcdbf62f9a4400050d2 (/ dev/asm-diskc) [OCR]

3. ONLINE 8b7b21ad7d114f21bf5e703ec4ccc44e (/ dev/asm-diskd) [OCR]

Located 3 voting disk (s).

3. Export ocr

[root@rac2 ~] # ocrconfig-export / tmp/ocr_20160202.dmp

[root@rac2 ~] # ll tmp | grep 2016

Ls: cannot access tmp: there is no such file or directory

[root@rac2 ~] # ll / tmp | grep 2016

-rw- 1 root root 114426 February 2 11:06 ocr_20160202.dmp

4. View backup

[root@rac2 ~] # ocrconfig-showbackup

Rac2 2016-02-01 17:30:53 / g01/11ggrid/app/11.2.3/grid/backup00.ocr

Rac2 2016-02-01 13:30:53 / g01/11ggrid/app/11.2.3/grid/backup01.ocr

Rac2 2016-02-01 09:30:52 / g01/11ggrid/app/11.2.3/grid/backup02.ocr

Rac2 2016-01-31 01:30:49 / g01/11ggrid/app/11.2.3/grid/day.ocr

Rac1 2016-01-26 20:52:17 / g01/11ggrid/app/11.2.3/grid/week.ocr

PROT-25: Manual backups for the Oracle Cluster Registry are not available

5.

[grid@rac2 ~] $sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Tuesday February 2 11:07:09 2016

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connect to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production

With the Real Application Clusters and Automatic Storage Management options

SQL > create pfile='/home/grid/asm_pfile20160202.txt' from spfile

File created.

SQL > quit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production

With the Real Application Clusters and Automatic Storage Management options

[root@rac1] # crsctl stop crs-f

CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1'

CRS-2673: Attempting to stop 'ora.gipcd' on' rac1'

CRS-2673: Attempting to stop 'ora.cssdmonitor' on' rac1'

CRS-2673: Attempting to stop 'ora.mdnsd' on' rac1'

CRS-2677: Stop of 'ora.cssdmonitor' on' rac1' succeeded

CRS-2677: Stop of 'ora.gipcd' on' rac1' succeeded

CRS-2673: Attempting to stop 'ora.gpnpd' on' rac1'

CRS-2677: Stop of 'ora.mdnsd' on' rac1' succeeded

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.

[root@rac1] # 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-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.cluster_interconnect.haip' on' rac1' succeeded

CRS-2672: Attempting to start 'ora.asm' on' rac1'

CRS-2676: Start of 'ora.asm' on' rac1' succeeded

[root@rac1 ~] # crsctl query css votedisk

# # STATE File Universal Id File Name Disk group

1. ONLINE 4b031d63f88f4f0cbf5cc8688884d5f2 (/ dev/asm-diskb) [OCR]

2. ONLINE 1acaf51067b94fcdbf62f9a4400050d2 (/ dev/asm-diskc) [OCR]

3. ONLINE 8b7b21ad7d114f21bf5e703ec4ccc44e (/ dev/asm-diskd) [OCR]

Located 3 voting disk (s).

[root@rac1 ~] # dd if=/dev/zero of=/dev/asm-diskb bs=1024 count=1000

Recorded a reading of 1000: 0

Recorded the write out of 1000: 0.

1024000 bytes (1.0 MB) replicated, 0.0754203 seconds, 13.6 MB/ seconds

[root@rac1 ~] # dd if=/dev/zero of=/dev/asm-diskc bs=1024 count=1000

Recorded a reading of 1000: 0

Recorded the write out of 1000: 0.

1024000 bytes (1.0 MB) replicated, 0.0656402 seconds, 15.6 MB/ seconds

[root@rac1 ~] # dd if=/dev/zero of=/dev/asm-diskd bs=1024 count=1000

Recorded a reading of 1000: 0

Recorded the write out of 1000: 0.

1024000 bytes (1.0 MB) replicated, 0.056022 seconds, 18.3 MB/ seconds

[grid@rac1 ~] $sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Tuesday February 2 11:23:17 2016

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connect to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production

With the Real Application Clusters and Automatic Storage Management options

SQL > shutdown immediate

ASM diskgroups dismounted

ASM instance shutdown

SQL > startup pfile='/home/grid/asm_pfile20160202.txt'

ASM instance has been started

Total System Global Area 283930624 bytes

Fixed Size 2227664 bytes

Variable Size 256537136 bytes

ASM Cache 25165824 bytes

ORA-15032: not all alterations performed

ORA-15017: diskgroup "OCR" cannot be mounted

ORA-15063: ASM discovered an insufficient number of disks for diskgroup "OCR"

SQL > select group_number, disk_number, mount_status, header_status, path from v$asm_disk

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS HEADER_STATUS

PATH

-

0 3 CLOSED CANDIDATE

/ dev/asm-diskd

0 4 CLOSED CANDIDATE

/ dev/asm-diskb

0 5 CLOSED CANDIDATE

/ dev/asm-diskc

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS HEADER_STATUS

PATH

-

1 2 CACHED MEMBER

/ dev/asm-diskg

1 1 CACHED MEMBER

/ dev/asm-diskf

1 0 CACHED MEMBER

/ dev/asm-diske

6 rows selected.

SQL > create diskgroup OCR normal redundancy disk'/ dev/asm-diskb','/dev/asm-diskc','/dev/asm-diskd' attribute 'compatible.asm'='11.2.0.0.0',' compatible.rdbms'='11.2.0.0.0'

Diskgroup created.

SQL > create spfile='+OCR' from pfile='/home/grid/asm_pfile20160202.txt'

File created.

SQL > quit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production

With the Real Application Clusters and Automatic Storage Management options

[grid@rac1 ~] $ocrconfig-showbackup

PROT-26: retrieved the backup location of the Oracle cluster registry from the local copy

Rac2 2016-02-01 13:30:53 / g01/11ggrid/app/11.2.3/grid/backup00.ocr

Rac2 2016-02-01 09:30:52 / g01/11ggrid/app/11.2.3/grid/backup01.ocr

Rac2 2016-02-01 05:30:52 / g01/11ggrid/app/11.2.3/grid/backup02.ocr

Rac2 2016-01-31 01:30:49 / g01/11ggrid/app/11.2.3/grid/day.ocr

Rac1 2016-01-26 20:52:17 / g01/11ggrid/app/11.2.3/grid/week.ocr

PROT-25: manual backup of the Oracle cluster registry is not available

[root@rac1 ~] # ocrconfig-restore / g01/11ggrid/app/11.2.3/grid/week.ocr

[root@rac1 ~] # crsctl replace votedisk + OCR

Diskgroup + OCR is already configured with voting files

CRS-4000: Command Replace failed, or completed with errors.

[root@rac1 ~] # crsctl stop crs

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.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.ctssd' on' rac1' succeeded

CRS-2677: Stop of 'ora.cluster_interconnect.haip' on' rac1' succeeded

CRS-2673: Attempting to stop 'ora.cssd' on' rac1'

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.

[root@rac1] # 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-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.cluster_interconnect.haip' on' rac1' succeeded

CRS-2672: Attempting to start 'ora.asm' on' rac1'

CRS-2676: Start of 'ora.asm' on' rac1' succeeded

[root@rac1 ~] # crsctl query css votedisk

Located 0 voting disk (s).

[root@rac1 ~] # su-grid

[grid@rac1 ~] $sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Tuesday February 2 11:38:47 2016

Copyright (c) 1982, 2011, Oracle. All rights reserved.

Connect to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production

With the Real Application Clusters and Automatic Storage Management options

SQL > shutdown immediate

ASM diskgroups dismounted

ASM instance shutdown

SQL > startup pfile='/home/grid/asm_pfile20160202.txt'

ASM instance started

Total System Global Area 283930624 bytes

Fixed Size 2227664 bytes

Variable Size 256537136 bytes

ASM Cache 25165824 bytes

ASM diskgroups mounted

SQL > set lines 1000

SQL > select group_number, disk_number, mount_status, header_status, path from v$asm_disk

GROUP_NUMBER DISK_NUMBER MOUNT_STATUS HEADER_STATUS PATH

- - - - - - -

1 2 CACHED MEMBER / dev/asm-diskg

1 1 CACHED MEMBER / dev/asm-diskf

1 0 CACHED MEMBER / dev/asm-diske

2 2 CACHED MEMBER / dev/asm-diskd

2 0 CACHED MEMBER / dev/asm-diskb

2 1 CACHED MEMBER / dev/asm-diskc

6 rows selected.

SQL > create diskgroup OCR normal redundancy disk'/ dev/asm-diskb','/dev/asm-diskc','/dev/asm-diskd' attribute 'compatible.asm'='11.2.0.0.0',' compatible.rdbms'='11.2.0.0.0'

Create diskgroup OCR normal redundancy disk'/ dev/asm-diskb','/dev/asm-diskc','/dev/asm-diskd' attribute 'compatible.asm'='11.2.0.0.0',' compatible.rdbms'='11.2.0.0.0'

*

ERROR at line 1:

ORA-15018: diskgroup cannot be created

ORA-15030: diskgroup name "OCR" is in use by another diskgroup

SQL > create spfile='+OCR' from pfile='/home/grid/asm_pfile20160202.txt'

File created.

SQL > quit

Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-64bit Production

With the Real Application Clusters and Automatic Storage Management options

[grid@rac1 ~] $su-

Password:

[root@rac1 ~] # ocrconfig-restore / g01/11ggrid/app/11.2.3/grid/week.ocr

[root@rac1 ~] # crsctl replace votedisk + OCR

Successful addition of voting disk 263eb678cbb34fdfbf3a7e565be61d35.

Successful addition of voting disk 1c39e6bd1fa34f60bfbf691dd9f4f98b.

Successful addition of voting disk 3ccd631501724f95bfc2f3150a2e4201.

Successfully replaced voting disk group with + OCR.

CRS-4266: Voting file (s) successfully replaced

[root@rac1 ~] # ocrcheck

Status of Oracle Cluster Registry is as follows:

Version: 3

Total space (kbytes): 262120

Used space (kbytes): 2860

Available space (kbytes): 259260

ID: 811139123

Device/File Name: + ocr

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@rac1 ~] # crsctl query css votedisk

# # STATE File Universal Id File Name Disk group

1. ONLINE 263eb678cbb34fdfbf3a7e565be61d35 (/ dev/asm-diskb) [OCR]

2. ONLINE 1c39e6bd1fa34f60bfbf691dd9f4f98b (/ dev/asm-diskc) [OCR]

3. ONLINE 3ccd631501724f95bfc2f3150a2e4201 (/ dev/asm-diskd) [OCR]

Located 3 voting disk (s).

[root@rac1 ~] # crsctl stop crs

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.mdnsd' on' rac1'

CRS-2677: Stop of 'ora.mdnsd' on' rac1' succeeded

CRS-2677: Stop of 'ora.ctssd' 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-2673: Attempting to stop 'ora.cssd' on' rac1'

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.

[root@rac1 ~] # crsctl start crs

CRS-4123: Oracle High Availability Services has been started.

[root@rac1 ~] # reboot

[grid@rac1] $crs_stat-v-t

Name type R/RA F/FT target status host

Ora.DATA.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1

Ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE rac1

Ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac1

Ora.OCR.dg ora....up.type 0/5 0/ ONLINE ONLINE rac1

Ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac1

Ora.cvu ora.cvu.type 0/5 0/0 ONLINE ONLINE rac1

Ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE

Ora.kingsql.db ora....se.type 0/2 0/1 ONLINE ONLINE rac1

Ora....network ora....rk.type 0/5 0/ ONLINE ONLINE rac1

Ora.oc4j ora.oc4j.type 0/1 0/2 ONLINE ONLINE rac1

Ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac1

Ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac1

Ora....C1.lsnr application 0/5 0/0 ONLINE ONLINE rac1

Ora.rac1.gsd application 0/5 0/0 OFFLINE OFFLINE

Ora.rac1.ons application 0/3 0/0 ONLINE ONLINE rac1

Ora.rac1.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac1

Ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac2

Ora....C2.lsnr application 0/5 0/0 ONLINE ONLINE rac2

Ora.rac2.gsd application 0/5 0/0 OFFLINE OFFLINE

Ora.rac2.ons application 0/3 0/0 ONLINE ONLINE rac2

Ora.rac2.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac2

Ora.scan1.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac1

At this point, I believe you have a deeper understanding of "what is the method for RAC11G to restore OCR". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report