OCR Replacement-Replace Existing OCR Disk with New One-Oracle RAC 11GR2
----------------------Prerequisite for Activity--------------
1.OCR Backup Manually & Automatically to other location:
You can use the ocrconfig -manualbackup command to force Oracle Clusterware to perform a backup of the OCR at any time, rather than wait for the automatic backup that occurs at 4-hour intervals.3$GRID_HOME/bin
./ocrconfig -manualbackup
./ocrconfig -showbackup
2.Export OCR Backup
./ocrconfig -export /tmp/ocr_export_date.exp3.Import OCR Backup
---------------------Voting Disk----------------------------------
1.Require 3 Luns of 500 Mb each of different-2 storage.
/dev/mapper/VOTE_V1 ---Violin Storage/dev/mapper/VOTE_H1 ----Hitachi Storage
/dev/mapper/VOTE_V2 ----Violin Storage
Create 3 Luns of 500Mb each. If possible put each Lun in different controller, array or storage.
2.DISK Creation from root user on one of the Node(node 1) i.e 1.***.43.**
2.1) For Voting
oracleasm createdisk VOTE_V1 /dev/mapper/VOTE_V1oracleasm createdisk VOTE_H1 /dev/mapper/VOTE_H1
oracleasm createdisk VOTE_V2 /dev/mapper/VOTE_V2
oracleasm scandisks
oracleasm listdisks
3.SCAN DISK ON Another Node(node 2) i.e 1.***.43.** from root user.
oracleasm scandisks4.Create Voting Diskgroup with NORMAL REDUNDANCY along with three failgroup.
CREATE DISKGROUP VOTE_GRP NORMAL REDUNDANCYFAILGROUP VOTE_FAIL_V1 DISK 'ORCL:VOTE_V1'
FAILGROUP VOTE_FAIL_H1 DISK 'ORCL:VOTE_H1'
FAILGROUP VOTE_FAIL_V2 DISK 'ORCL:VOTE_V2'
ATTRIBUTE 'compatible.asm' = '11.2.0.1.0';
---------------------OCR Disk----------------------------------
1.Require 2 Luns of 500 Mb each of different-2 storage.
/dev/mapper/CRS_V1 ---Violin Storage/dev/mapper/CRS_H1 ----Hitachi Storage
2.DISK Creation from root user on one of the Node 1 i.e 1.***.43.**
oracleasm createdisk CRS_V1 /dev/mapper/CRS_V1oracleasm createdisk CRS_H1 /dev/mapper/CRS_H1
oracleasm scandisks
oracleasm listdisks
3.SCAN DISK ON Another Node(node 2) i.e 1.***.43.** from root user.
oracleasm scandisks4.Create CRS Diskgroup with NORMAL REDUNDANCY along with two failgroup.
CREATE DISKGROUP CRS_GRP NORMAL REDUNDANCYFAILGROUP CRS_FAIL_V1 DISK 'ORCL:CRS_V1'
FAILGROUP CRS_FAIL_H1 DISK 'ORCL:CRS_H1'
ATTRIBUTE 'compatible.asm' = '11.2.0.1.0';
---------------------------------Verification----------------------------------
TO check Diskgroup Provissioned/Not
SET LINESIZE 150
COL PATH FOR A30
COL NAME FOR A10
COL HEADER_STATUS FOR A20
COL FAILGROUP FOR A20
COL FAILGROUP_TYPE FOR A20
COL VOTING_FILE FOR A20
SELECT NAME,PATH,HEADER_STATUS,FAILGROUP, FAILGROUP_TYPE, VOTING_FILE
FROM V$ASM_DISK
WHERE GROUP_NUMBER IN ( SELECT GROUP_NUMBER FROM V$ASM_DISKGROUP WHERE NAME IN ('CRS_GRP','VOTE_GRP'));
Mount the diskgroup on another node (node2)i.e 1.***.43.**-
#alter diskgroup VOTE_GRP mount;#alter diskgroup CRS_GRP mount;
-----------------------CURRENT OCR/VOTING CONFIGURATION---------
------------------------OCR--------------------------------------
[root@NEWDB1 bin]# ./ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 3768
Available space (kbytes) : 258352
ID : 1579853954
Device/File Name : +OCRDATA
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check succeeded
------------------------VOTING--------------------------------------
[grid@NEWDB1 ~]$ crsctl query css votedisk## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 8f6bd01f079d4f06bf3beb78f18e9bfc (ORCL:OCRDATA1) [OCRDATA]
Located 1 voting disk(s).
Moving Voting Files from existing disk group to New DiskGroup
This should be run during Maintaince Window.Instances should be down of all the nodes.============From grid user under GRID_HOME
$crsctl replace votedisk VOTE_GRP (VOTE_GRP is a new Diskgroup for Voting file)$crsctl query css votedisk
To check current voting disk configuration
TO check Diskgroup Provissioned/Not
SET LINESIZE 150
COL PATH FOR A30
COL NAME FOR A10
COL HEADER_STATUS FOR A20
COL FAILGROUP FOR A20
COL FAILGROUP_TYPE FOR A20
COL VOTING_FILE FOR A20
SELECT NAME,PATH,HEADER_STATUS,FAILGROUP, FAILGROUP_TYPE, VOTING_FILE
FROM V$ASM_DISK
WHERE GROUP_NUMBER IN ( SELECT GROUP_NUMBER FROM V$ASM_DISKGROUP WHERE NAME IN ('VOTE_GRP'));
Moving OCR Files from existing disk group to New DiskGroup
# /u01/app/11.2.0/grid/bin/ocrconfig -add +CRS_GRP#/u01/app/11.2.0/grid/bin/ocrcheck
# /u01/app/11.2.0/grid/bin/ocrconfig -add +VOTE_GRP
#/u01/app/11.2.0/grid/bin/ocrcheck
--------------------Replace Existing OCR Disk with New One------------------------------
# ocrconfig -replace +OCRDATA -replacement +CRS_GRP
DELETE EARLIER DISKGROUP INFORMATION FROM OCR
#/u01/app/11.2.0/grid/bin/ocrconfig -delete +OCRDATA#/u01/app/11.2.0/grid/bin/ocrcheck
=================DROP OLD OCR DISKGROUP LATER----------------------
login from grid user & connected as sys as sysasm
sql>alter diskgroup OCRDATA dismount; #It should dismount before drop#####
sql>alter diskgroup OCRDATA mount;
sql>drop diskgroup OCRDATA including contents;