In sweet memories of my ever loving brother "kutty thambi " ARUN KUMAR
Showing posts with label OCR. Show all posts
Showing posts with label OCR. Show all posts

Saturday, December 26, 2009

How to ADD/REMOVE/REPLACE/MOVE Oracle Cluster Registry (OCR) and Voting Disk

Purpose
To provide step to add, remove, replace or move an OCR or voting disk in Oracle
Real Application Clusters (RAC) 10g Realese 2 (10.2.0.1 and later)
environments.
SCOPE & APPLICATION
This article is intended for DBAs and Support Engineers who need to modify, or
move OCR and voting disk locations. Customers, who have an existing clustered
environment deployed on a storage array, 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 clusterware has the OCR and voting disks open and is actively using
them. (Both the primary and the mirrors)
2. There is a “cluster api” provided for this function (ocrconfig, and
crsctl), which is a better 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.
Examples are included at the end of OCR and voting disk command.
ADD/REMOVE/REPLACE OCR Device
Note: You must be logged in as the root user, because root own the OCR files.
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 a an export of
the online OCR file:
ocrconfig –export -s online
If you need to recover using this file, the following command can be used:
ocrconfig import
1. To add an OCR device:
To add an OCR device, provide the full path including file name.
ocrconfig -replace ocr
To add an OCR mirror device, provide the full path including file name.
ocrconfig -replace ocrmirror
2. To remove an OCR device:
To remove an OCR device:
ocrconfig -replace ocr
To remove an OCR mirror device
ocrconfig -replace ocrmirror
3. To replace or move the location of an OCR device:
To replace the OCR device with , provide the full path including file
name.
ocrconfig -replace ocr
To replace the OCR mirror device with , provide the full path
including file name.
ocrconfig -replace ocrmirror
Example moving OCR file from OCFS to raw devices
The OCR disk must be owned by root, must be in the oinstall group, and must have permissions set
to 640. Provide at least 100 MB disk space for the OCR.
In this example the OCR file are located in the ocfs2 file system:
/ocfs2/ocr1
/ocfs2/ocr2
Create raw device files of at least 100 MB. In this example the new OCR file
will be on the following devices:
/dev/raw/raw1
/dev/raw/raw2
Once the raw devices are created, use the dd command to zero out the device and
make sure no data is written to the raw devices:
dd if=/dev/zero of=/dev/raw/raw1
dd if=/dev/zero of=/dev/raw/raw2
Note: Use UNIX man pages for additional information on the dd command.
Now you are ready to move/replace the OCR file to the new storage location.
Move/Replace the OCR device
ocrconfig -replace ocr /dev/raw/raw1
Add /dev/raw/raw2 as OCR mirror device
ocrconfig -replace ocr /dev/raw/raw2
Example of adding an OCR device file
If you have upgraded your environment from a previous version, where you only
had 1 OCR device file, you can use the following step to add an additional OCR
file.
In this example a second OCR device file is added:
Add /dev/raw/raw2 as OCR mirror device
ocrconfig -replace ocr /dev/raw/raw2
ADD/DELETE/MOVE Voting Disk
Note: 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
Take a backup of all voting disk:
dd if=voting_disk_name of=backup_file_name
Note: Use UNIX man pages for additional information on the dd command.
The following can be used to restore the voting disk from the backup file
created.
dd if=backup_file_name of=voting_disk_name
1. To add a Voting Disk, provide the full path including file name.:
crsctl add votedisk css -force
2. To delete a Voting Disk, provide the full path including file name.:
crsctl delete votedisk css -force
3. To move a Voting Disk, provide the full path including file name.:
crsctl delete votedisk css –force
crsctl add votedisk css –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
Example moving Voting Disk from OCFS to raw devices
The voting disk is a partition that Oracle Clusterware uses to verify cluster
node membership and status.
The voting disk must be owned by the oracle user, must be in the dba
group, and must have permissions set to 644. Provide at least 20 MB disk
space for the voting disk.
In this example the Voting Disks are located in the ocfs2 file system:
/ocfs2/voting1
/ocfs2/voting2
/ocfs2/voting3
Create raw device files of at least 20 MB. In this example the new voting
disks will be on the following devices:
/dev/raw/raw3
/dev/raw/raw4
/dev/raw/raw5
Once the raw devices are created, use the dd command to zero out the device and
make sure no data is written to the raw devices:
dd if=/dev/zero of=/dev/raw/raw3
dd if=/dev/zero of=/dev/raw/raw4
dd if=/dev/zero of=/dev/raw/raw5
Note: Use UNIX man pages for additional information on the dd command.
Now you are ready to move/replace the voting disks to the new storage location.
To move a Voting Disk to new storage location:
crsctl delete votedisk css /ocfs2/voting1 –force
crsctl add votedisk css /dev/raw/raw3 –force
crsctl delete votedisk css /ocfs2/voting2 –force
crsctl add votedisk css /dev/raw/raw4 –force
crsctl delete votedisk css /ocfs2/voting3 –force
crsctl add votedisk css /dev/raw/raw5 –force
Example of adding Voting Disks
If you have upgraded your environment from a previous version, where you only
had 1 voting disk, you can use the following steps to add additional voting
disk.
In this example 2 additional Voting Disks are added:
crsctl add votedisk css /dev/raw/raw4 –force
crsctl add votedisk css /dev/raw/raw5 –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

Administering OCR in RAC

What is a voting disk?
A voting disk is a file that manages information about node membership.
What are the administrative tasks involved with voting disk?
Following administrative tasks are performed with the voting disk :
1) Backing up voting disks
2) Recovering Voting disks
3) Adding voting disks
4) Deleting voting disks
5) Moving voting disks
How do we backup voting disks?
1) Oracle recommends that you back up your voting disk after the initial cluster creation and after we complete any node addition or deletion procedures.
2) First, as root user, stop Oracle Clusterware (with the crsctl stop crs command) on all nodes. Then, determine the current voting disk by issuing the following command:
crsctl query css votedisk
3) Then, issue the dd or ocopy command to back up a voting disk, as appropriate.
Give the syntax of backing up voting disks:-
On Linux or UNIX systems:
dd if=voting_disk_name of=backup_file_name
where,
voting_disk_name is the name of the active voting disk
backup_file_name is the name of the file to which we want to back up the voting disk contents
On Windows systems, use the ocopy command:
ocopy voting_disk_name backup_file_name
What is the Oracle Recommendation for backing up voting disk?
Oracle recommends us to use the dd command to backup the voting disk with aminimum block size of 4KB.
How do you restore a voting disk?
To restore the backup of your voting disk, issue the dd or ocopy command for Linux and UNIX systems or ocopy for Windows systems respectively.
On Linux or UNIX systems:
dd if=backup_file_name of=voting_disk_name
On Windows systems, use the ocopy command:
ocopy backup_file_name voting_disk_name
where,
backup_file_name is the name of the voting disk backup file
voting_disk_name is the name of the active voting disk
How can we add and remove multiple voting disks?
If we have multiple voting disks, then we can remove the voting disks and add them back into our environment using the following commands, where path is the complete path of the location where the voting disk resides:
crsctl delete css votedisk path
crsctl add css votedisk path
How do we stop Oracle Clusterware?When do we stop it?
Before making any modification to the voting disk, as root user, stop Oracle Clusterware using the crsctl stop crs command on all nodes.
How do we add voting disk?
To add a voting disk, issue the following command as the root user, replacing the path variable with the fully qualified path name for the voting disk we want to add:
crsctl add css votedisk path -force
How do we move voting disks?
To move a voting disk, issue the following commands as the root user, replacing the path variable with the fully qualified path name for the voting disk we want to move:
crsctl delete css votedisk path -force
crsctl add css votedisk path -force
How do we remove voting disks?
To remove a voting disk, issue the following command as the root user, replacing the path variable with the fully qualified path name for the voting disk we want to remove:
crsctl delete css votedisk path -force
What should we do after modifying voting disks?
After modifying the voting disk, restart Oracle Clusterware using the crsctl start crs command on all nodes, and verify the voting disk location using the following command:
crsctl query css votedisk
When can we use -force option?
If our cluster is down, then we can include the -force option to modify the voting disk configuration, without interacting with active Oracle Clusterware daemons. However, using the -force option while any cluster node is active may corrupt our configuration.

OCRCHECK in CLUSTERWARE, RAC

What is an OCRCHECK utility?
An ocrcheck utility is a diagnostic tool used for diagnosing OC(Oracle Cluster Registry) Problems.This is used to verify the Oracle Cluster Registry(OCR) integrity.
What does an ocrcheck display?
The OCRCHECK utility displays the version of the OCR’s block format, total space available and used space, OCRID, and the OCR locations that we have configured.
How does ocrcheck perform integrity check?
OCRCHECK performs a block-by-block checksum operation for all of the blocks in all of the OCRs that we have configured. It also returns an individual status for each file as well as a result for the overall OCR integrity check.
Give a sample output of ocrcheck utility:-
Sample of the OCRCHECK utility output:
Status of Oracle Cluster Registry is as follows :
Version : 2
Total space (kbytes) : 262144
Used space (kbytes) : 16256
Available space (kbytes) : 245888
ID : 1918913332
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

Where does an ocrcheck utility create a log file?
OCRCHECK creates a log file in the directory CRS_home/log/hostname/client.
How can we change the amount of logging?
To change amount of logging, edit the file CRS_home/srvm/admin/ocrlog.ini.


free counters
 
Share/Bookmark