首页 > Linux操作系统 > Linux操作系统 > How To : OCR / Vote disk Maintenance Operations: (ADD/REMOVE/REPLACE/MOVE)
| OCR / Vote disk Maintenance Operations: (ADD/REMOVE/REPLACE/MOVE) [ID 428681.1] | |||||
| Modified 23-SEP-2011 Type HOWTO Status PUBLISHED | |||||
In this Document
Goal
Solution
References
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:ocrconfig –showbackup
In 11.1# ocrconfig –export-s online
node1 2008/08/06 06:11:58 /crs/cdata/crs/backup_20080807_003158.ocr# ocrconfig -manualbackup
1. To add an OCRMIRROR device when only OCR device defined:# 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
2. To remove an OCR device:# ocrconfig -replace ocrmirror
To remove an OCR mirror device:# ocrconfig -replace ocr* 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.
# ocrconfig -replace ocrmirror
To replace the OCR mirror device with# ocrconfig -replace ocr
Example Moving OCR from Raw Device to Block Device# ocrconfig -replace ocrmirror
For moving the OCR from raw device to block device there are two different ways. One, which requires a full cluster outage, and one with no outage. The offline method is recommended for 10.2 and earlier since a cluster outage is required anyways due to an Oracle bug, which prevents online addition and deletion of voting files. This bug is fixed in 11.1, so either online or offline method can be employed in 11.1 onwards./dev/raw/raw1
/dev/raw/raw2
For every ocrconfig or ocrcheck command a trace file to $CRS_Home/log/# ocrconfig -replace ocr /dev/sdb1
# ocrconfig -replace ocrmirror /dev/sdc1
Method 2 (Offline)Version : 2
Total space (kbytes) : 497776
Used space (kbytes) : 3844
Available space (kbytes) : 493932
ID : 576761409
Device/File Name : /dev/sdb1
Device/File integrity check succeeded
Device/File Name : /dev/sdc2
Device/File integrity check succeeded
Cluster registry integrity check succeeded
/dev/raw/raw1 /dev/sdb1
/dev/raw/raw2 /dev/sdc1# raw -qa
/dev/raw/raw1: bound to major 8, minor 17
/dev/raw/raw2: bound to major 8, minor 33# ls –ltra /dev/raw/raw*
crw-r----- 1 root oinstall 162, 1 Jul 24 10:39 /dev/raw/raw1
crw-r----- 1 root oinstall 162, 2 Jul 24 10:39 /dev/raw/raw2# ls -ltra /dev/*
brw-r----- 1 root oinstall 8, 17 Jul 24 10:39 /dev/sdb1
brw-r----- 1 root oinstall 8, 33 Jul 24 10:39 /dev/sdc1
3. On one node as root run:# ocrconfig -repair ocr /dev/sdb1
# ocrconfig -repair ocrmirror /dev/sdc1
In the $CRS_Home/log/# ocrconfig -overwrite
cat /crs/log/node1/client/ocrconfig_20022.logAs a verification step run ocrcheck on all nodes and the Device/File Name should reflect the block devices replacing the raw devices:Oracle Database 10g CRS Release 10.2.0.4.0 Production Copyright 1996, 2008 Oracle. All rights reserved.
2008-08-06 06:41:29.736: [ OCRCONF][3086866112]ocrconfig starts...
2008-08-06 06:41:31.535: [ OCRCONF][3086866112]Successfully overwrote OCR configuration on disk
2008-08-06 06:41:31.535: [ OCRCONF][3086866112]Exiting [status=success]...
Example of adding an OCR device file on raw device# ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 497776
Used space (kbytes) : 3844
Available space (kbytes) : 493932
ID : 576761409
Device/File Name : /dev/sdb1
Device/File integrity check succeeded
Device/File Name : /dev/sdc1
Device/File integrity check succeeded
Cluster registry integrity check succeeded
Example of adding/replacing OCR/OCRMIRROR on cluster file system# ocrconfig -replace ocrmirror /dev/raw/raw2
2. To delete a Voting Disk, provide the full path including file name:# crsctl add css votedisk-force
3. To move a Voting Disk, provide the full path including file name:# crsctl delete css votedisk-force
After modifying the voting disk, start the Oracle Clusterware stack on all nodes# crsctl add css votedisk–force
# crsctl delete css votedisk–force
Verify the voting disk location using# crsctl start crs
11.1.0.6 and onwards# crsctl query css votedisk
Backup Voting before starting any modification./dev/raw/raw4
/dev/raw/raw5
/dev/raw/raw6
Backup Voting# crsctl query css votedisk
0. 0 /dev/raw/raw4
1. 0 /dev/raw/raw5
2. 0 /dev/raw/raw6
located 3 votedisk(s).
For Windows:$ dd if=voting_disk_name f=backup_file_name
ocopy \\.\votedsk1 o:\backup\votedsk1.bak
2) Shutdown Oracle Clusterware on all nodes using "crsctl stop crs" as root.# crsctl query css votedisk
0. 0 /dev/raw/raw4
1. 0 /dev/raw/raw5
2. 0 /dev/raw/raw6
located 3 votedisk(s).
4) Verify with crsctl query css votedisk:# crsctl delete css votedisk /dev/raw/raw4 -force
# crsctl add css votedisk /dev/vote1 -force
# crsctl delete css votedisk /dev/raw/raw5 -force
# crsctl delete css votedisk /dev/raw/raw6 -force
# crsctl add css votedisk /dev/vote2 -force
# crsctl add css votedisk /dev/vote3 –force
5) After this the Oracle Clusterware stack can be restarted with "crsctl start crs" as root. (Only required for 10g CRS)# crsctl query css votedisk
0. 0 /dev/vote1
1. 0 /dev/vote2
2. 0 /dev/vote3
located 3 votedisk(s).
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/7419833/viewspace-713123/ ,如需转载,请注明出处,否则将追究法律责任。