Beruflich Dokumente
Kultur Dokumente
1
Copyright (c) 2020, Oracle. All rights reserved. Oracle Confidential.
In this Document
Goal
Solution
Prepare the disks
1. Size
2. For raw or block device (pre 11.2)
3. For ASM disks (11.2+)
4. For cluster file system
5. Permissions
6. Redundancy
ADD/REMOVE/REPLACE/MOVE OCR Device
1. To add an OCRMIRROR device when only OCR device is defined:
2. To remove an OCR device
3. To replace or move the location of an OCR device
4. To restore an OCR when clusterware is down
ADD/DELETE/MOVE Voting Disk
For 10gR2 release
For 11gR1 release
For 11gR2 release and later
For online OCR/Voting diskgroup change
For Voting disk maintenance in Extended Cluster
Community Discussions
References
APPLIES TO:
GOAL
The goal of this note is to provide steps to add, remove, replace or move an Oracle Cluster Repository (OCR) and/or
Voting Disk in Oracle Clusterware 10gR2, 11gR1 and 11gR2 environment. It will also provide steps to move OCR / voting
and ASM devices from raw device to block device. For Oracle Clusterware 12c, please refer to Document 1558920.1
Software Patch Level and 12c Grid Infrastructure OCR Backup/Restore.
This article is intended for DBA and Support Engineers who need to modify, or move OCR and voting disks files, customers
who have an existing clustered environment deployed on a storage array and might want to migrate to a new storage
array with minimal downtime.
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=a2jtmij6f_237&id=428681.1 1/10
9/28/2020 Document 428681.1
Typically, one would simply cp or dd the files once the new storage has been presented to the hosts. In this case, it is a
little more difficult because:
1. The Oracle Clusterware has the OCR and voting disks open and is actively using them. (Both primary and mirrors)
2. There is an API provided for this function (ocrconfig and crsctl), which is the appropriate interface than typical cp
and/or dd commands.
It is highly recommended to take a backup of the voting disk, and OCR device before making any changes.
Note: while the OCR and Voting disk files may be stored together, such as in OCFS (for example in pre-11.2
Clusterware environments) or in the same ASM diskgroup (for example in 11.2 Oracle Clusterware environments), OCR
and Voting disk files are in fact two separate files or entities and so if the intention is to modify or move both OCR and
Voting disk files, then one must follow steps provided for both of these types of files.
SOLUTION
For OCR or voting disk addition or replacement, new disks need to be prepared. Please refer to Clusteware/Gird
Infrastructure installation guide for different platform for the disk requirement and preparation.
1. Size
For 10.1:
OCR device minimum size (each): 100M
Voting disk minimum size (each): 20M
For 10.2:
OCR device minimum size (each): 256M
Voting disk minimum size (each): 256M
For 11.1:
OCR device minimum size (each): 280M
Voting disk minimum size (each): 280M
For 11.2:
OCR device minimum size (each): 300M
Voting disk minimum size (each): 300M
Please refer to Clusterware installation guide on different platform for more details.
On windows platform the new raw device link is created via $CRS_HOME\bin\GUIOracleOBJManager.exe, for example:
\\.\VOTEDSK2
\\.\OCR2
On Windows platform, please refer to Document 331796.1 How to setup ASM on Windows
On Linux platform, please refer to Document 580153.1 How To Setup ASM on Linux Using ASMLIB Disks, Raw Devices or
Block Devices?
For other platform, please refer to Clusterware/Gird Infrastructure installation guide on OTN (Chapter: Oracle Automatic
Storage Management Storage Configuration).
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=a2jtmij6f_237&id=428681.1 2/10
9/28/2020 Document 428681.1
If OCR is on cluster file system, the new OCR or OCRMIRROR file must be touched before add/replace command can be
issued. Otherwise PROT-21: Invalid parameter (10.2/11.) or PROT-30 The Oracle Cluster Registry location to be added is
not accessible (for 11.2) will occur.
As root user
# touch /cluster_fs/ocrdisk.dat
# touch /cluster_fs/ocrmirror.dat
# chown root:oinstall /cluster_fs/ocrdisk.dat /cluster_fs/ocrmirror.dat
# chmod 640 /cluster_fs/ocrdisk.dat /cluster_fs/ocrmirror.dat
After delete command is issued, the ocr/voting files on the cluster file system require to be removed manually.
5. Permissions
6. Redundancy
Insufficient failure group in respect of redundancy requirement could cause voting disk creation failure. For example: ORA-
15274: Not enough failgroups (3) to create voting files
For OCR:
10.2 and 11.1, maximum 2 OCR devices: OCR and OCRMIRROR
11.2+, upto 5 OCR devices can be added.
For more information, please refer to platform specific Oracle® Grid Infrastructure Installation Guide.
Note: You must be logged in as the root user, because root owns the OCR files. "ocrconfig -replace" command can
only be issued when CRS is running, otherwise "PROT-1: Failed to initialize ocrconfig" will occur.
Please ensure CRS is running on ALL cluster nodes during this operation, otherwise the change will not
reflect in the CRS down node, CRS will have problem to startup from this down node. "ocrconfig -repair" option will be
required to fix the ocr.loc file on the CRS down node.
For 11.2+ with OCR on ASM diskgroup, due to unpublished Bug 8604794 - FAIL TO CHANGE OCR LOCATION TO DG
WITH 'OCRCONFIG -REPAIR -REPLACE', "ocrconfig -repair" to change OCR location to different ASM diskgroup does
not work currently. Workaround is to manually edit /etc/oracle/ocr.loc or /var/opt/oracle/ocr.loc or Windows registry
HYKEY_LOCAL_MACHINE\SOFTWARE\Oracle\ocr, point to desired diskgroup.
If there is any issue with OLR, please refer to How to restore OLR in 11.2 Grid Infrastructure Note 1193643.1.
Make sure there is a recent copy of the OCR file before making any changes:
ocrconfig -showbackup
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=a2jtmij6f_237&id=428681.1 3/10
9/28/2020 Document 428681.1
If there is not a recent backup copy of the OCR file, an export can be taken for the current OCR file. Use the following
command to generate an export of the online OCR file:
In 10.2
# ocrconfig -manualbackup
node1 2008/08/06 06:11:58 /crs/cdata/crs/backup_20080807_003158.ocr
From 11.2+, please also refer How to restore ASM based OCR after complete loss of the CRS diskgroup on Linux/Unix
systems Document 1062983.1
To see whether OCR is healthy, run an ocrcheck, which should return with like below.
# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 497928
Used space (kbytes) : 312
Available space (kbytes) : 497616
ID : 576761409
Device/File Name : /dev/raw/raw1
Device/File integrity check succeeded
Device/File Name : /dev/raw/raw2
Device/File integrity check succeeded
To add an OCR mirror device, provide the full path including file name.
10.2 and 11.1:
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=a2jtmij6f_237&id=428681.1 4/10
9/28/2020 Document 428681.1
11.2+:
* Once an OCR device is removed, ocrmirror device automatically changes to be OCR device.
* It is not allowed to remove OCR device if only 1 OCR device is defined, the command will return PROT-
16.
11.2+:
After removal, the old OCR/OCRMIRROR can be deleted if they are on cluster filesystem.
Note. 1. An ocrmirror must be in place before trying to replace the OCR device. The ocrconfig will fail with PROT-16, if
there is no ocrmirror exists.
2. If an OCR device is replaced with a device of a different size, the size of the new device will not be reflected until
the clusterware is restarted.
To replace the OCR mirror device with <filename>, provide the full path including file name.
11.2+:
The command is same for replace either OCR or OCRMIRRORs (at least 2 OCR exist for replace command to work):
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=a2jtmij6f_237&id=428681.1 5/10
9/28/2020 Document 428681.1
When OCR is not accessible, CRSD process will not start, hence the clusterware stack will not start completely. A restore of
OCR device access and good OCR content is required.
To view the automatic OCR backup:
# ocrconfig -showbackup
For 11.2+: If OCR is located in ASM disk and ASM disk is also lost, please check out:
How to restore ASM based OCR after complete loss of the CRS diskgroup on Linux/Unix systems Document 1062983.1
How to Restore OCR After the 1st ASM Diskgroup is Lost on Windows Document 1294915.1
If there is no valid backup of OCR presented, reinitialize OCR and Voting is required.
For 10.2 and 11.1:
Please refer to How to Recreate OCR/Voting Disk Accidentally Deleted Document 399482.1
For 11.2+:
Deconfig the clusterware stack and rerun root.sh on all nodes is required.
Note: 1. crsctl votedisk commands must be run as root for 10.2 and 11.1, but can be run as grid user for 11.2+
2. For 11.2+, when using ASM disks for OCR and voting, the command is same for Windows and Unix platform.
$ dd if=voting_disk_name of=backup_file_name
For Windows:
For 11.2+, it is no longer required to back up the voting disk. The voting disk data is automatically backed up in OCR as
part of any configuration change. The voting disk files are backed up automatically by Oracle Clusterware if the contents of
the files have changed in the following ways:
The voting disk contents are restored from a backup automatically when a new voting disk is added or replaced.
Shutdown the Oracle Clusterware (crsctl stop crs as root) on all nodes before making any modification to the voting disk.
Determine the current voting disk location using:
crsctl query css votedisk
1. To add a Voting Disk, provide the full path including file name:
2. To delete a Voting Disk, provide the full path including file name:
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=a2jtmij6f_237&id=428681.1 6/10
9/28/2020 Document 428681.1
3. To move a Voting Disk, provide the full path including file name, add a device first before deleting the old
one:
After modifying the voting disk, start the Oracle Clusterware stack on all nodes
Starting with 11.1.0.6, the below commands can be performed online (CRS is up and running).
1. To add a Voting Disk, provide the full path including file name:
2. To delete a Voting Disk, provide the full path including file name:
3. To move a Voting Disk, provide the full path including file name:
From 11.2, votedisk can be stored on either ASM diskgroup or cluster file systems. The following commands can only be
executed when Grid Infrastructure is running. As grid user:
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=a2jtmij6f_237&id=428681.1 7/10
9/28/2020 Document 428681.1
b. When votedisk is on ASM, no delete option available, one can only replace the existing votedisk group with another ASM
diskgroup
4. To move voting disk on ASM from one diskgroup to another diskgroup due to redundancy change or disk
location change
Example here is moving from external redundancy +OCRVOTE diskgroup to normal redundancy +CRS diskgroup
5. To move voting disk between ASM diskgroup and cluster file system
a. Move from ASM diskgroup to cluster file system:
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=a2jtmij6f_237&id=428681.1 8/10
9/28/2020 Document 428681.1
6. To verify:
For disk storage migration, if using ASM diskgroup and the size / diskgroup redundancy remain the same, then one can
use add failure group contain new storage and drop failure group which contain old storage to achieve this online change.
For more information, please refer to How to Swap Voting Disks Across Storage in a Diskgroup (Doc ID 1558007.1) and
Exact Steps To Migrate ASM Diskgroups To Another SAN/Disk-Array/DAS/etc Without Downtime. (Doc ID 837308.1)
Please refer to Oracle White paper: Oracle Clusterware 11g Release 2 (11.2) – Using standard NFS to support a third
voting file for extended cluster configurations
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=a2jtmij6f_237&id=428681.1 9/10
9/28/2020 Document 428681.1
If there is any issue using asmca tool, please refer to How to Manually Add NFS voting disk to an Extended Cluster using
ASM in 11.2 Note 1421588.1 for detailed commands.
Community Discussions
Still have questions? Use the communities window below to search for similar discussions or start a new discussion on this
subject. (Window is the live community not a screenshot)
REFERENCES
NOTE:1558920.1 - Software Patch Level and 12c Grid Infrastructure OCR Backup/Restore
NOTE:1062983.1 - How to Restore ASM Based OCR After Complete Loss of the CRS Diskgroup on Linux/Unix Systems
NOTE:1573574.1 - OCR Placement and Size Specification
NOTE:866102.1 - Renaming OCR Using "ocrconfig -overwrite" Fails
NOTE:390880.1 - OCR Corruption after Adding/Removing voting disk to a cluster when CRS stack is running
Didn't find what you are looking for?
https://support.oracle.com/epmos/faces/DocumentDisplay?_adf.ctrl-state=a2jtmij6f_237&id=428681.1 10/10