OCR / Vote disk Maintenance Operations: (ADD/REMOVE/REPLACE/MOVE) [ID 428681.1]
OCR / Vote disk Maintenance Operations: (ADD/REMOVE/REPLACE/MOVE) [ID 428681.1]
In this Document
Goal |
Fix |
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 |
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 |
ADD/DELETE/MOVE Voting Disk |
For 10gR2 release |
For 11gR1 release |
For 11gR2 release |
References |
Applies to:
Oracle Server - Enterprise Edition - Version 10.2.0.1 to 11.2.0.3 [Release 10.2 to 11.2]Information in this document applies to any platform.
Goal
The goal of this note is to provide steps to add, remove, replace or move an Oracle Cluster Repository (OCR) 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.
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.
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.
Oracle Cluster Registry (OCR) and Voting Disk Additional clarifications
For Voting disks (never use even number of voting disks):
External redundancy means 1 voting disk
Normal redundancy means 3 voting disks
High redundancy means 5 voting disks
For OCR: 10.2 and 11.1, maximum 2 OCR devices: OCR and OCRMIRROR
11.2+, upto 5 OCR devices can be added.
Fix
Prepare the disks
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
2. For raw or block device (pre 11.2)
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
3. For ASM disks (11.2+)
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.
4. For cluster file system
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.
# 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
It is not required to pre-touch voting disk file on cluster file system.
After delete command is issued, the ocr/voting files on the cluster file system require to be removed manually.
5. Permissions
For OCR device:
chown root:oinstall
chmod 640
For Voting device:
chown
chmod 644
For ASM disks used for OCR/Voting disk:
chown griduser:asmadmin
chmod 660
ADD/REMOVE/REPLACE/MOVE OCR Device
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/ocr.loc or Windows registry HYKEY_LOCAL_MACHINE\SOFTWARE\Oracle\ocr, point to desired diskgroup.
Make sure there is a recent copy of the OCR file before making any changes:
ocrconfig -showbackup
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 -export-s online
In 11.1 and 11.2
# ocrconfig -manualbackup
node1 2008/08/06 06:11:58 /crs/cdata/crs/backup_20080807_003158.ocr
To recover using this file, the following command can be used:
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
Cluster registry integrity check succeeded
For 11.1+, ocrcheck as root user should also show:
Logical corruption check succeeded
1. To add an OCRMIRROR device when only OCR device is defined:
To add an OCR mirror device, provide the full path including file name.
10.2 and 11.1:
# ocrconfig -replace ocrmirror
eg:
# ocrconfig -replace ocrmirror /dev/raw/raw2
# ocrconfig -replace ocrmirror /dev/sdc1
# ocrconfig -replace ocrmirror /cluster_fs/ocrdisk.dat
> ocrconfig -replace ocrmirror \\.\OCRMIRROR2 - for Windows
11.2+: From 11.2 onwards, upto 4 ocrmirrors can be added
# ocrconfig -add
eg:
# ocrconfig -add +OCRVOTE2
# ocrconfig -add /cluster_fs/ocrdisk.dat
2. To remove an OCR device
To remove an OCR device:
10.2 and 11.1:
# ocrconfig -replace ocr
11.2+:
# ocrconfig -delete
eg:
# ocrconfig -delete +OCRVOTE1
* 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.
To remove an OCR mirror device:
10.2 and 11.1:
# ocrconfig -replace ocrmirror
11.2+:
# ocrconfig -delete
eg:
# ocrconfig -delete +OCRVOTE2
After removal, the old OCR/OCRMIRROR can be deleted if they are on cluster filesystem.
3. To replace or move the location of an OCR device
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.
10.2 and 11.1:
To replace the OCR device with
# ocrconfig -replace ocr
eg:
# ocrconfig -replace ocr /dev/sdd1
$ ocrconfig -replace ocr \\.\OCR2 - for Windows
To replace the OCR mirror device with
# ocrconfig -replace ocrmirror
eg:
# ocrconfig -replace ocrmirrow /dev/raw/raw4
# ocrconfig -replace ocrmirrow \\.\OCRMIRROR2 - for Windows
11.2:
The command is same for replace either OCR or OCRMIRRORs (at least 2 OCR exist for replace command to work):
eg:
# ocrconfig -replace /cluster_file/ocr.dat -replacement +OCRVOTE
# ocrconfig -replace +CRS -replacement +OCRVOTE
ADD/DELETE/MOVE Voting Disk
2. For 11.2, when using ASM disks for OCR and voting, the command is same for Windows and Unix platform.
To take a backup of voting disk:
$ dd if=voting_disk_name f=backup_file_name
For Windows:
ocopy \\.\votedsk1 o:\backup\votedsk1.bak
For 10gR2 release
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:
# crsctl add css votedisk-force
eg:
# crsctl add css votedisk /dev/raw/raw1 -force
# crsctl add css votedisk /cluster_fs/votedisk.dat -force
> crsctl add css votedisk \\.\VOTEDSK2 -force - for windows
2. To delete a Voting Disk, provide the full path including file name:
# crsctl delete css votedisk-force
eg:
# crsctl delete css votedisk /dev/raw/raw1 -force
# crsctl delete css votedisk /cluster_fs/votedisk.dat -force
> crsctl delete css votedisk \\.\VOTEDSK1 -force - for windows
3. To move a Voting Disk, provide the full path including file name, add a device first before deleting the old one:
# crsctl add css votedisk-force
# crsctl delete css votedisk-force
eg:
# crsctl add css votedisk /dev/raw/raw4 -force
# crsctl delete css votedisk /dev/raw/raw1 -force
After modifying the voting disk, start the Oracle Clusterware stack on all nodes
# crsctl start crs
Verify the voting disk location using
# crsctl query css votedisk
For 11gR1 release
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:
eg:
# crsctl add css votedisk /dev/raw/raw1
# crsctl add css votedisk /cluster_fs/votedisk.dat
> crsctl add css votedisk \\.\VOTEDSK2 - for windows
2. To delete a Voting Disk, provide the full path including file name:
eg:
# crsctl delete css votedisk /dev/raw/raw1 -force
# crsctl delete css votedisk /cluster_fs/votedisk.dat
> crsctl delete css votedisk \\.\VOTEDSK1 - for windows
3. To move a Voting Disk, provide the full path including file name:
# crsctl delete css votedisk
eg:
# crsctl add css votedisk /dev/raw/raw4
# crsctl delete css votedisk /dev/raw/raw1
Verify the voting disk location:
For 11gR2 release
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:
1. To add a Voting Disk
a. When votedisk is on cluster file system:
b. When votedisk is on ASM diskgroup, no add option available.
The number of votedisk is determined by the diskgroup redundancy. If more copy of votedisk is desired, one can move votedisk to a diskgroup with higher redundancy. See step 4.
If a votedisk is removed from a normal or high redundancy diskgroup for abnormal reason, it can be added back using:
2. To delete a Voting Disk
a. When votedisk is on cluster file system:
b. When votedisk is on ASM, no delete option available, one can only replace the existing votedisk group with another ASM diskgroup
3. To move a Voting Disk on cluster file system
$ crsctl delete css votedisk
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
2. $ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 5e391d339a594fc7bf11f726f9375095 (ORCL:ASMDG02) [+OCRVOTE]
Located 1 voting disk(s).
3. $ crsctl replace votedisk +CRS
Successful addition of voting disk 941236c324454fc0bfe182bd6ebbcbff.
Successful addition of voting disk 07d2464674ac4fabbf27f3132d8448b0.
Successful addition of voting disk 9761ccf221524f66bff0766ad5721239.
Successful deletion of voting disk 5e391d339a594fc7bf11f726f9375095.
Successfully replaced voting disk group with +CRS.
CRS-4266: Voting file(s) successfully replaced
4. $ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 941236c324454fc0bfe182bd6ebbcbff (ORCL:CRSD1) [CRS]
2. ONLINE 07d2464674ac4fabbf27f3132d8448b0 (ORCL:CRSD2) [CRS]
3. ONLINE 9761ccf221524f66bff0766ad5721239 (ORCL:CRSD3) [CRS]
Located 3 voting disk(s).
5. To move voting disk between ASM diskgroup and cluster file system
a. Move from ASM diskgroup to cluster file system:
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 6e5850d12c7a4f62bf6e693084460fd9 (ORCL:CRSD1) [CRS]
2. ONLINE 56ab5c385ce34f37bf59580232ea815f (ORCL:CRSD2) [CRS]
3. ONLINE 4f4446a59eeb4f75bfdfc4be2e3d5f90 (ORCL:CRSD3) [CRS]
Located 3 voting disk(s).
$ crsctl replace votedisk /rac_shared/oradata/vote.test3
Now formatting voting disk: /rac_shared/oradata/vote.test3.
CRS-4256: Updating the profile
Successful addition of voting disk 61c4347805b64fd5bf98bf32ca046d6c.
Successful deletion of voting disk 6e5850d12c7a4f62bf6e693084460fd9.
Successful deletion of voting disk 56ab5c385ce34f37bf59580232ea815f.
Successful deletion of voting disk 4f4446a59eeb4f75bfdfc4be2e3d5f90.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 61c4347805b64fd5bf98bf32ca046d6c (/rac_shared/oradata/vote.disk) []
Located 1 voting disk(s).
b. Move from cluster file system to ASM diskgroup
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 61c4347805b64fd5bf98bf32ca046d6c (/rac_shared/oradata/vote.disk) []
Located 1 voting disk(s).
$ crsctl replace votedisk +CRS
CRS-4256: Updating the profile
Successful addition of voting disk 41806377ff804fc1bf1d3f0ec9751ceb.
Successful addition of voting disk 94896394e50d4f8abf753752baaa5d27.
Successful addition of voting disk 8e933621e2264f06bfbb2d23559ba635.
Successful deletion of voting disk 61c4347805b64fd5bf98bf32ca046d6c.
Successfully replaced voting disk group with +CRS.
CRS-4256: Updating the profile
CRS-4266: Voting file(s) successfully replaced
[oragrid@auw2k4 crsconfig]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 41806377ff804fc1bf1d3f0ec9751ceb (ORCL:CRSD1) [CRS]
2. ONLINE 94896394e50d4f8abf753752baaa5d27 (ORCL:CRSD2) [CRS]
3. ONLINE 8e933621e2264f06bfbb2d23559ba635 (ORCL:CRSD3) [CRS]
Located 3 voting disk(s).
6. To verify:
References
NOTE:390880.1 - OCR Corruption after Adding/Removing voting disk to a cluster when CRS stack is runningNOTE:1062983.1 - How to restore ASM based OCR after complete loss of the CRS diskgroup on Linux/Unix systems
NOTE:866102.1 - Renaming OCR Using "ocrconfig -overwrite" Fails
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/17252115/viewspace-749515/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- OCR / Vote disk Maintenance Operations: (ADD/REMOVE/REPLACE/MOVE)AINaNREM
- 官方版本的關於 OCR / Vote disk 維護: (ADD/REMOVE/REPLACE/MOVE) 收藏此主題REM
- 官方版本的關於 OCR / Vote disk 維護: (ADD/REMOVE/REPLACE/MOVE) 收藏此主題[轉]REM
- RAC關鍵資訊(OCR/VOTE DISK/ASM DISK HEADER)備份ASMHeader
- OCR/Vote disk 維護操作: (新增/刪除/替換/移動) (文件 ID 1674859.1)
- 【MOS】OCR/Vote disk 維護操作: (新增/刪除/替換/移動) (文件 ID 1674859.1)
- ORACLE 10.2.0.5 RAC OCR&vote disk 磁碟遷移 DG Rebalance測試Oracle
- Three commands for OCR maintenanceAINaN
- redhat 5.3 版本建立 ocr 和voteRedhat
- 等待事件:Disk file operations I/O事件
- move linux os from disk A to disk B with 0 lossLinux
- How to move ASM spfile to a different disk group [ID 1082943.1]ASM
- Grid Control remove host and re-add hostREM
- 利用UDEV配置OCR VOTE(基於整個磁碟)dev
- ASM重新命名包含OCR/vote file的磁碟組ASM
- 管理OCR,OLR,Voting Disk(筆記)筆記
- Oracle RAC 重建 OCR 和 Voting diskOracle
- 【Mongodb】sharding 叢集Add/Remove 節點MongoDBREM
- How to Add a New Disk new partition in centos7CentOS
- OCR And Voting Disk In Oracle 10gR2 Clusterware (RAC) [ID 1092293.1]Oracle 10g
- Android 覆蓋安裝會同時傳送remove和replace的解決方案AndroidREM
- Oracle10g OCR及Voting Disk的Oracle
- 解決 ocrconfig -replace ocr Fails With PROT-16AI
- oracle 11gR2 如何對ocr和vote盤進行鏡象Oracle
- Dynamics CRM Add/Remove a Tab in an entity form using plug-inREMORM
- Placement of Voting disk and OCR Files in Oracle RAC 10g and 11gR1 [ID 293819.1]Oracle
- 11g RAC OCR,VOTING DISK儲存全部損壞,利用自動備份,恢復OCR,VOTING DISK到新儲存。
- Oracle10g OCR及Voting Disk的備份Oracle
- oracle 11gr2 針對ocr/vote asm diskgroup損壞的處理方法OracleASM
- [RAC]使用ocrconfig -replace命令建立ocr鏡象檔案
- add disk to asm on aix操作步驟及注意事項-orastarASMAIAST
- 11g RAC 中 OCR 及Voting Disk 相關操作
- Oracle 10g RAC下Voting disk和OCR的管理Oracle 10g
- Oracle 10G RAC下OCR和Voting disk的管理Oracle 10g
- [轉載]Log Shipping Operations GuideGUIIDE
- 執行ocrconfig replace ocr出現PROT-16錯誤
- [20210326]Disk file operations IO與檔案型資料庫.txt資料庫
- Remove Invalid Parentheses[難]REM