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 recovery of OCR disk damage?

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

Share

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

This article shows you what OCR disk damage recovery is like, the content is concise and easy to understand, can definitely brighten your eyes, through the detailed introduction of this article, I hope you can get something.

Train of thought:

1.ocr is corrupted (dd destroys the disk)

two。 The cluster of all nodes is turned off, the resources are closed, and the db is closed.

3. Select a node to execute crsctl start crs-excl-nocrs to start asm

After 4.as sysasm enters, create a new disk group and create the spfile of the asm parameter file to the new disk group, then shutdown immdiate closes asm, and then startup starts to use the new parameter file.

5. Restore crs

6. Restore voting disk

Steps:

Before destroying ocr, we have to see if our ocr backups exist. There are two types of backups, manual and automatic.

First take a brief look at the redundancy mode of ocr disks

This is my test environment. Ocr is in normal mode.

SQL > select name,type from v$asm_diskgroup

NAME TYPE

DATA NORMAL

This is another environment where ocr is externally redundant.

SQL > select name,type from v$asm_diskgroup

NAME TYPE

DATA_PTL EXTERN

OCR_PTL EXTERN

View automatic backup

The default automatic backup path is $CRS_HOME/cdata/$CRS_NAME

Automatic backups are performed on only one node. If the node used for backup has an exception, oracle automatically switches to another node for backup.

By default, oracle keeps the last five ocr backups: three recent, one from yesterday, and one from last week.

[root@host01 bin] #. / ocrconfig-showbackup

Host01 2016-03-24 06:48:42 / u01/app/11.2.0/grid/cdata/cluster01/backup00.ocr

Host01 2016-03-24 02:48:42 / u01/app/11.2.0/grid/cdata/cluster01/backup01.ocr

Host01 2016-03-23 22:48:41 / u01/app/11.2.0/grid/cdata/cluster01/backup02.ocr

Host01 2016-03-23 14:48:40 / u01/app/11.2.0/grid/cdata/cluster01/day.ocr

Host01 2016-03-23 14:48:40 / u01/app/11.2.0/grid/cdata/cluster01/week.ocr

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

[root@host01 bin] # ll / u01/app/11.2.0/grid/cdata/cluster01/

Total 43344

-rw- 1 root root 7385088 Mar 24 06:48 backup00.ocr

-rw- 1 root root 7385088 Mar 24 02:48 backup01.ocr

-rw- 1 root root 7385088 Mar 23 22:48 backup02.ocr

-rw- 1 root root 7385088 Mar 24 02:48 day_.ocr

-rw- 1 root root 7385088 Mar 23 14:48 day.ocr

-rw- 1 root root 7385088 Mar 23 14:48 week.ocr

Check the integrity of the ocr:

[oracle@host01 bin] $pwd

/ u01/app/11.2.0/grid/bin

[oracle@host01 bin] $. / cluvfy comp ocr-n all

Verifying OCR integrity

Checking OCR integrity...

Checking the absence of a non-clustered configuration...

All nodes free of non-clustered, local-only configurations

ASM Running check passed. ASM is running on all specified nodes

Checking OCR config file "/ etc/oracle/ocr.loc"...

OCR config file "/ etc/oracle/ocr.loc" check successful

Disk group for ocr location "+ DATA" available on all the nodes

NOTE:

This check does not verify the integrity of the OCR contents. Execute 'ocrcheck' as a privileged user to verify the contents of OCR.

OCR integrity check passed

Verification of OCR integrity was successful.

You can also use ocrcheck to check the integrity of ocr:

[oracle@host01 bin] $. / ocrcheck

Status of Oracle Cluster Registry is as follows:

Version: 3

Total space (kbytes): 262120

Used space (kbytes): 3064

Available space (kbytes): 259056

ID: 764742178

Device/File Name: + DATA

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 bypassed due to non-privileged user

[oracle@host01 bin] $

[root@host02 ~] # / u01/app/11.2.0/grid/bin/ocrcheck

Status of Oracle Cluster Registry is as follows:

Version: 3

Total space (kbytes): 262120

Used space (kbytes): 3064

Available space (kbytes): 259056

ID: 764742178

Device/File Name: + DATA

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

Check the voting disk information:

[oracle@host01 bin] $. / crsctl query css votedisk

# # STATE File Universal Id File Name Disk group

1. ONLINE a19ebdf15f374f81bf6af6cd31ed413f (/ dev/oracleasm/disks/ASMDISK1) [DATA]

2. ONLINE 6854e5df9d314f36bfc0a65db37c5db1 (/ dev/oracleasm/disks/ASMDISK2) [DATA]

3. ONLINE 45f2a22766864fd8bf00694c9d8029d3 (/ dev/oracleasm/disks/ASMDISK3) [DATA]

Located 3 voting disk (s).

Back up the ocr file manually:

[root@host02 ~] # cd / u01/app/11.2.0/grid/bin/

[root@host02 bin] #. / ocrconfig-export / home/oracle/ocr_0326.dmp

Export the asm parameter file:

[oracle@host01 bin] $export ORACLE_HOME=/u01/app/11.2.0/grid

[oracle@host01 bin] $export ORACLE_SID=+ASM1

[oracle@host01 bin] $/ u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Sat Mar 26 14:57:03 2016

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-Production

With the Real Application Clusters and Automatic Storage Management options

SQL > select name,state from v$asm_diskgroup

NAME STATE

DATA MOUNTED

SQL > show parameter spfile

NAME TYPE VALUE

-

Spfile string + DATA/cluster01/asmparameterfi

Le/registry.253.906557533

SQL > create pfile='/home/oracle/asmpfile.ora' from spfile

File created.

SQL > exit

[oracle@host01 ~] $cat asmpfile.ora

* .asm_diskstring='/dev/oracleasm/disks'

* .asm_power_limit=1

* .diagnostic_dest='/u01/app/oracle'

* .instance_type='asm'

* .large_pool_size=12M

* .remote_login_passwordfile='EXCLUSIVE'

Destroy the OCR disk:

[oracle@host01 bin] $dd if=/dev/zero of=/dev/oracleasm/disks/ASMDISK1 bs=1024 count=1000

1000000 records in

1000000 records out

1024000 bytes (1.0 MB) copied, 0.00300442 seconds, 341MB/s

[oracle@host01 bin] $dd if=/dev/zero of=/dev/oracleasm/disks/ASMDISK2 bs=1024 count=1000

1000000 records in

1000000 records out

1024000 bytes (1.0 MB) copied, 0.072793 seconds, 14.1MB/s

It is important to note here that in order to recover ocr information, the disk group must be mount. So you can also restore ocr to another disk group, and then modify the / etc/oracle/ocr.loc file when you modify it.

[root@host02 bin] #. / crsctl stop cluster

CRS-2673: Attempting to stop 'ora.crsd' on' host02'

CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'host02'

CRS-2673: Attempting to stop 'ora.LISTENER_SCAN2.lsnr' on' host02'

CRS-2673: Attempting to stop 'ora.registry.acfs' on' host02'

CRS-2673: Attempting to stop 'ora.DATA.dg' on' host02'

CRS-2673: Attempting to stop 'ora.oc4j' on' host02'

CRS-2673: Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on' host02'

CRS-2673: Attempting to stop 'ora.cvu' on' host02'

CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on' host02'

CRS-2677: Stop of 'ora.cvu' on' host02' succeeded

CRS-2672: Attempting to start 'ora.cvu' on' host01'

CRS-2677: Stop of 'ora.LISTENER.lsnr' on' host02' succeeded

CRS-2673: Attempting to stop 'ora.host02.vip' on' host02'

CRS-2677: Stop of 'ora.LISTENER_SCAN2.lsnr' on' host02' succeeded

CRS-2673: Attempting to stop 'ora.scan2.vip' on' host02'

CRS-2676: Start of 'ora.cvu' on' host01' succeeded

CRS-2677: Stop of 'ora.scan2.vip' on' host02' succeeded

CRS-2672: Attempting to start 'ora.scan2.vip' on' host01'

CRS-2677: Stop of 'ora.LISTENER_SCAN3.lsnr' on' host02' succeeded

CRS-2673: Attempting to stop 'ora.scan3.vip' on' host02'

CRS-2677: Stop of 'ora.scan3.vip' on' host02' succeeded

CRS-2672: Attempting to start 'ora.scan3.vip' on' host01'

CRS-2677: Stop of 'ora.host02.vip' on' host02' succeeded

CRS-2672: Attempting to start 'ora.host02.vip' on' host01'

CRS-2676: Start of 'ora.scan2.vip' on' host01' succeeded

CRS-2672: Attempting to start 'ora.LISTENER_SCAN2.lsnr' on' host01'

CRS-2676: Start of 'ora.scan3.vip' on' host01' succeeded

CRS-2672: Attempting to start 'ora.LISTENER_SCAN3.lsnr' on' host01'

CRS-2676: Start of 'ora.host02.vip' on' host01' succeeded

CRS-2677: Stop of 'ora.registry.acfs' on' host02' succeeded

CRS-2676: Start of 'ora.LISTENER_SCAN3.lsnr' on' host01' succeeded

CRS-2676: Start of 'ora.LISTENER_SCAN2.lsnr' on' host01' succeeded

CRS-2677: Stop of 'ora.oc4j' on' host02' succeeded

CRS-2672: Attempting to start 'ora.oc4j' on' host01'

CRS-2676: Start of 'ora.oc4j' on' host01' succeeded

CRS-2677: Stop of 'ora.DATA.dg' on' host02' succeeded

CRS-2673: Attempting to stop 'ora.asm' on' host02'

CRS-2677: Stop of 'ora.asm' on' host02' succeeded

CRS-2673: Attempting to stop 'ora.ons' on' host02'

CRS-2677: Stop of 'ora.ons' on' host02' succeeded

CRS-2673: Attempting to stop 'ora.net1.network' on' host02'

CRS-2677: Stop of 'ora.net1.network' on' host02' succeeded

CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'host02' has completed

CRS-2677: Stop of 'ora.crsd' on' host02' succeeded

CRS-2673: Attempting to stop 'ora.ctssd' on' host02'

CRS-2673: Attempting to stop 'ora.evmd' on' host02'

CRS-2673: Attempting to stop 'ora.asm' on' host02'

CRS-2677: Stop of 'ora.evmd' on' host02' succeeded

CRS-2677: Stop of 'ora.asm' on' host02' succeeded

CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on' host02'

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

CRS-2677: Stop of 'ora.ctssd' on' host02' succeeded

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

CRS-2677: Stop of 'ora.cssd' on' host02' succeeded

[root@host02 bin] #. / crsctl start cluster-failed to start

CRS-2672: Attempting to start 'ora.cssdmonitor' on' host02'

CRS-2676: Start of 'ora.cssdmonitor' on' host02' succeeded

CRS-2672: Attempting to start 'ora.cssd' on' host02'

CRS-2672: Attempting to start 'ora.diskmon' on' host02'

CRS-2676: Start of 'ora.diskmon' on' host02' succeeded

CRS-2674: Start of 'ora.cssd' on' host02' failed

CRS-2679: Attempting to clean 'ora.cssd' on' host02'

CRS-2681: Clean of 'ora.cssd' on' host02' succeeded

CRS-5804: Communication error with agent process

CRS-2672: Attempting to start 'ora.cssdmonitor' on' host02'

CRS-2676: Start of 'ora.cssdmonitor' on' host02' succeeded

CRS-2672: Attempting to start 'ora.cssd' on' host02'

CRS-2672: Attempting to start 'ora.diskmon' on' host02'

CRS-2676: Start of 'ora.diskmon' on' host02' succeeded

CRS-2674: Start of 'ora.cssd' on' host02' failed

CRS-2679: Attempting to clean 'ora.cssd' on' host02'

CRS-2681: Clean of 'ora.cssd' on' host02' succeeded

CRS-5804: Communication error with agent process

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

[root@host02 host02] # tail-20 alerthost02.log

2016-03-26 15 purl 03purl 56.872

[cssd (8781)] CRS-1603:CSSD on node host02 shutdown by user.

2016-03-26 15 purl 03purl 56.877

[ohasd (5017)] CRS-2765:Resource 'ora.cssdmonitor' has failed on server' host02'.

2016-03-26 15 0314 57.835

[ohasd (5017)] CRS-2767:Resource state recovery not attempted for 'ora.diskmon' as its target state is OFFLINE

2016-03-26 15 1415 03.500

[/ u01/app/11.2.0/grid/bin/cssdagent (8768)] CRS-5818:Aborted command 'start' for resource' ora.cssd'. Details at (: CRSAGF00113:) {0 in 0148} in / u01/app/11.2.0/grid/log/host02/agent/ohasd/oracssdagent_root/oracssdagent_root.log.

2016-03-26 15 1414 16.599

[cssd (9425)] CRS-1713:CSSD daemon is started in clustered mode

2016-03-26 15 1417.118

[cssd (9425)] CRS-1637:Unable to locate configured voting file with ID a19ebdf1-5f374f81 Murbf6af6cdMur31ed413f; details at (: CSSNM00020:) in / u01/app/11.2.0/grid/log/host02/cssd/ocssd.log

2016-03-26 15 1417.119

[cssd (9425)] CRS-1637:Unable to locate configured voting file with ID 6854e5dfmur9d314f36Melbfc0a65dlub37c5db1; details at (: CSSNM00020:) in / u01/app/11.2.0/grid/log/host02/cssd/ocssd.log

2016-03-26 15 1417.119

[cssd (9425)] CRS-1705:Found 1 configured voting files but 2 voting files are required, terminating to ensure data integrity; details at (: CSSNM00021:) in / u01/app/11.2.0/grid/log/host02/cssd/ocssd.log

2016-03-26 15 1417.119

[cssd (9425)] CRS-1656:The CSS daemon is terminating due to a fatal error; Details at (: CSSSC00012:) in / u01/app/11.2.0/grid/log/host02/cssd/ocssd.log

2016-03-26 15 1417.140

[cssd (9425)] CRS-1603:CSSD on node host02 shutdown by user.

[root@host02 bin] #. / ocrcheck

PROT-602: Failed to retrieve data from the cluster registry

PROC-26: Error while accessing the physical storage

ORA-29701: unable to connect to Cluster Synchronization Service

Start the cluster resource in exclusive mode but cannot afford crs:

[root@host01 bin] #. / crsctl disable crs

CRS-4621: Oracle High Availability Services autostart is disabled.

[root@host01 bin] # reboot

[root@host01 bin] #. / crsctl start crs-excl-nocrs

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

CRS-2672: Attempting to start 'ora.mdnsd' on' host01'

CRS-2676: Start of 'ora.mdnsd' on' host01' succeeded

CRS-2672: Attempting to start 'ora.gpnpd' on' host01'

CRS-2676: Start of 'ora.gpnpd' on' host01' succeeded

CRS-2672: Attempting to start 'ora.cssdmonitor' on' host01'

CRS-2672: Attempting to start 'ora.gipcd' on' host01'

CRS-2676: Start of 'ora.cssdmonitor' on' host01' succeeded

CRS-2676: Start of 'ora.gipcd' on' host01' succeeded

CRS-2672: Attempting to start 'ora.cssd' on' host01'

CRS-2672: Attempting to start 'ora.diskmon' on' host01'

CRS-2676: Start of 'ora.diskmon' on' host01' succeeded

CRS-2676: Start of 'ora.cssd' on' host01' succeeded

CRS-2672: Attempting to start 'ora.drivers.acfs' on' host01'

CRS-2679: Attempting to clean 'ora.cluster_interconnect.haip' on' host01'

CRS-2672: Attempting to start 'ora.ctssd' on' host01'

CRS-2681: Clean of 'ora.cluster_interconnect.haip' on' host01' succeeded

CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on' host01'

CRS-2676: Start of 'ora.ctssd' on' host01' succeeded

CRS-2676: Start of 'ora.drivers.acfs' on' host01' succeeded

CRS-2676: Start of 'ora.cluster_interconnect.haip' on' host01' succeeded

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

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

[root@host01 bin] #. / crsctl stat res-t

CRS-4535: Cannot communicate with Cluster Ready Services

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

[root@host01 bin] # ps-ef | grep smon

Oracle 5984 1 0 16:03? 00:00:00 asm_smon_+ASM1

Root 6079 5305 0 16:03 pts/1 00:00:00 grep smon

Create an asm parameter file:

[oracle@host01 ~] $export ORACLE_SID=+ASM1

[oracle@host01 ~] $export ORACLE_HOME=/u01/app/11.2.0/grid

[oracle@host01 ~] $/ u01/app/oracle/product/11.2.0/dbhome_1/bin/asmcmd

ASMCMD > ls

ASMCMD > exit

[oracle@host01 ~] $/ u01/app/oracle/product/11.2.0/dbhome_1/bin/sqlplus / as sysasm

SQL*Plus: Release 11.2.0.3.0 Production on Sat Mar 26 16:05:25 2016

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

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.3.0-Production

With the Real Application Clusters and Automatic Storage Management options

SQL > show parameter spfile

NAME TYPE VALUE

-

Spfile string

SQL > create diskgroup CRSVOTEDISK normal redundancy disk'/ dev/oracleasm/disks/ASMDISK7','/dev/oracleasm/disks/ASMDISK8','/dev/oracleasm/disks/ASMDISK9' attribute 'compatible.asm'='11.2.0.0.0',' compatible.rdbms'='11.2.0.0.0'

Diskgroup created.

Or:

Create diskgroup MAO external redundancy disk'/ dev/oracleasm/disks/ASMDISK10' attribute 'compatible.asm'='11.2.0.0.0',' compatible.rdbms'='11.2.0.0.0'

SQL > create spfile='+CRSVOTEDISK' from pfile='/home/oracle/asmpfile.ora'

File created.

[oracle@host01 ~] $/ u01/app/oracle/product/11.2.0/dbhome_1/bin/asmcmd

ASMCMD > ls

CRSVOTEDISK/

ASMCMD > ls C*

Cluster01/

ASMCMD > ls CentralPlacement c *

ASMPARAMETERFILE/

ASMCMD > ls CentralCompact caterpillar *

REGISTRY.253.907517283

Modify the pointing location of the ocr:

[root@host01 bin] # vi / etc/oracle/ocr.loc

# ocrconfig_loc=+DATA

Ocrconfig_loc=+CRSVOTEDISK

Local_only=FALSE

[root@host01 bin] #. / crsctl query css votedisk

Located 0 voting disk (s).

[root@host01 bin] #. / ocrconfig-import / root/ocr_0326.dmp-restore ocr

At this point, ocr has been imported into the asm disk group we just created (because the disk group to be imported by ocr is specified in the / etc/oracle/ocr file), then voting disk may be messy at this time, so replace voting disk to my ocr disk group with the following command.

[root@host01 bin] #. / crsctl replace votedisk + CRSVOTEDISK-restore voting disk

Successful addition of voting disk 4245abe430544f49bff06fe9e1debf54.

Successful addition of voting disk 8c470e646aaa4f28bfe517868b7d06b1.

Successful addition of voting disk af827499ece74f85bfa184aebfa1eeee.

Successfully replaced voting disk group with + CRSVOTEDISK.

CRS-4266: Voting file (s) successfully replaced

[root@host01 bin] #. / ocrcheck

Status of Oracle Cluster Registry is as follows:

Version: 3

Total space (kbytes): 262120

Used space (kbytes): 3064

Available space (kbytes): 259056

ID: 2105760671

Device/File Name: + CRSVOTEDISK

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@host01 bin] #. / crsctl query css votedisk

# # STATE File Universal Id File Name Disk group

1. ONLINE 4245abe430544f49bff06fe9e1debf54 (/ dev/oracleasm/disks/ASMDISK7) [CRSVOTEDISK]

2. ONLINE 8c470e646aaa4f28bfe517868b7d06b1 (/ dev/oracleasm/disks/ASMDISK8) [CRSVOTEDISK]

3. ONLINE af827499ece74f85bfa184aebfa1eeee (/ dev/oracleasm/disks/ASMDISK9) [CRSVOTEDISK]

Located 3 voting disk (s).

The pointing position of the ocr is also modified in node 2. Then restart the cluster on both sides.

[root@host01 bin] #. / crsctl stop crs

The above is what the recovery of OCR disk damage is like. Have you learned the knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

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

Database

Wechat

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

12
Report