OCR / Vote disk Maintenance Operations: (ADD/REMOVE/REPLACE/MOVE) (Doc ID 428681.1)
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.
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
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.
解释:
如果COR在集群文件系统上,那么必须先touch新的OCR或OCRMIRROR文件,然后才可以发出添加/替换命令。
否则会出现
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.
To add an OCRMIRROR device when only OCR device is defined:
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
解释:10.2and11.1 与 11.2 添加OCR镜像的方式
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.
解释:
当移除OCR设备后,ocrmirror设备将自动更改为OCR设备。
也就是说当添加ocrmirror设备,并不是成为OCR设备,只有当现存的OCR设备被移除后,ocrmirror设备将自动更改为OCR设备,如果只存在一个OCR设备,那么不允许将其移除。PROT-16
对于10.2和11.1时可以重建OCR/VF的
对于11.2,如果想重建OCR/VF 必须重新运行root.sh
ADD/DELETE/MOVE Voting Disk:
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.
For pre 11.2, to take a backup of voting disk:
$ dd if=voting_disk_name of=backup_file_name
For Windows:
ocopy \.\votedsk1 o:\backup\votedsk1.bak
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:
- Configuration parameters, for example
misscount, have been added or modified - After performing voting disk
addordeleteoperations
The voting disk contents are restored from a backup automatically when a new voting disk is added or replaced.
解释:
对于11.2之前的版本,要备份表决磁盘
$ dd if = voting_disk_name of = backup_file_name
对于11.2以后,不需要再备份voting disk,在OCR的自动备份包含Voting disk的数据
如果voting files内容被修改,那么voting files会被集群自动备份
voting files内容被修改的情况如下:
misscount等配置参数
add or delete voting disk
For 11gR2 release and later
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:
$ crsctl add css votedisk
b. When votedisk is on ASM diskgroup, no add option available.
The number of votedisk is determined by the diskgroup redundancy. If more copies of votedisks are 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:
alter diskgroup
解释:
1.在11g R2版本开始,VF可以存储在ASM磁盘组或集群文件系统上。
2.当VF位于集群文件系统上时,可以使用crsctl add css votedisk添加
当VF位于ASM磁盘组上时,不可使用该命令进行添加
3.VF的数量由磁盘组冗余度确定,如果修改VF的数量,则可以将VF移动到冗余度更高的磁盘组中
4.如果VF从一个normal或high冗余度磁盘组中被异常删除,则可以强制添加
alter diskgroup add disk '' force;
2. To delete a Voting Disk
a. When votedisk is on cluster file system:
$ crsctl delete css votedisk
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 add css votedisk
4. To move voting disk on ASM from one diskgroup to another diskgroup due to redundancy change or disk location change $ crsctl replace votedisk <+diskgroup>|
解释:
or
$ crsctl delete css votedisk
1.当VF位于集群文件系统上时可以执行删除命令
$ crsctl delete css votedisk
$ crsctl delete css votedisk
or
$ crsctl delete css votedisk
可以通过将ASM上的VF从一个磁盘组移动到另一个磁盘组,来更改冗余度或磁盘的位置
$ crsctl replace votedisk <+diskgroup>|