subject         part

stay Oracle in , Replace OCR What are the steps for a disk group ?


          Answer section          

Core commands :

1crsctl replace votedisk +newocr
2ocrconfig -add +newocr
3ocrconfig -delete +ocr
4more /etc/oracle/ocr.loc
6spcopy -u +CRSDG/xx/asmparameterfile/registry.xx +newocr/spfileASM.ora


The specific steps include :

1.  Add new storage

establish Normal Redundancy level OCR The volume group , You need at least 3 individual LUN, Every LUN The minimum capacity is 1GB, It needs to be configured on the storage side 3 individual LUN to RAC Each node in the cluster .

2.  Multipath binding configuration

To configure /etc/multipatch.conf, Add new disk UUID, Suppose the path after the multi-path binding is /dev/mapper/newocr1、/dev/mapper/newocr2、/dev/mapper/newocr3, And reload Mutilpathd Services take effect .

3. ASMLib Configuration or udev binding

node 1 The operation is as follows :

Will add new 3 individual LUN Add to ASMLIB in

1# /usr/sbin/oracleasm createdisk OCRNEW1 /dev/mapper/newocr1
2# /usr/sbin/oracleasm createdisk OCRNEW2 /dev/mapper/newocr2
3# /usr/sbin/oracleasm createdisk OCRNEW3 /dev/mapper/newocr3


node 2:

Scan the new 3 individual LUN:

1# /usr/sbin/oracleasm scandisks
2# /usr/sbin/oracleasm listdisks


4.  Backup OCR

— Logical backup recovery

1ocrconfig -export /oracle/app/11.2.0/grid/cdata/ZFTPCCDB-crs/export_asm.bak


— Physical backup recovery

1ocrconfig -manualbackup
2ocrconfig -showbackup


5.  newly build OCR The volume group

1set line 9999
2set pagesize 9999
3col path format a60
4SELECT a.group_number, disk_number,mount_status, a.name, path FROM v$asm_disk a order by a.disk_number;
5set line 999
6select name,state,free_mb,required_mirror_free_mb,usable_file_mb,a.group_number, disk_number,mount_status, path from v$asm_diskgroup a;
7select a.group_number,name,TYPE,state,TOTAL_MB,free_mb from v$asm_diskgroup a;
8select name,state,free_mb,required_mirror_free_mb,usable_file_mb,a.group_number from v$asm_diskgroup a;


node 1 newly build Normal Redundancy level ASM The volume group

1sqlplus / as sysasm
2create diskgroup newocr normal redundancy disk
6attribute 'compatible.asm'='11.2','compatible.rdbms'='11.2';


node 1 perform mount Disk group :

2crsctl stat res -t


6.  Replace VOTE

At one of the nodes ,root Execute under the user :

Replace VOTE

1crsctl replace votedisk +newocr



1crsctl query css votedisk


7.  Replace OCR

stay grid or root Execute under the user :

Node1 Execute the following command :

1ocrconfig -add +newocr
2ocrconfig -delete +ocr
3more /etc/oracle/ocr.loc


Node2 You don’t have to execute the following commands :

1ocrconfig -repair -add +newocr
2ocrconfig -repair -delete +ocr


8.  transfer ASM SPFILE

stay GRID Any node under the user executes

1$ asmcmd


View the current ASMSPFILE

1ASMCMD> spget


Copy SPFILE To the new volume group

1ASMCMD> spcopy -u +CRSDG/xx/asmparameterfile/registry.xx +newocr/spfileASM.ora


Check out the new SPFILE Absolute path

1ASMCMD> ls -l +newocr/spfileASM.ora


Modify two nodes grid Under the user $ORACLE_HOME/dbs/init.ora The contents of the document , It can also be done without modification :



9.  Confirm old OCR Are there any other files in the pack

10.  Delete old OCR The volume group

After restarting the cluster :

node 2:

1su - grid
2sqlplus / as sysasm
3alter diskgroup OCR dismount;


node 1:

1su - grid
2sqlplus / as sysasm
3drop diskgroup ocr;


11.  Delete disk

Any node ROOT User down operation :

1# /usr/sbin/oracleasm dropdisk OCR


Delete multipath binding configuration , Delete the configuration /etc/multipatch.conf Central Plains OCR Contents of the disk .

Finally delete from storage to 2 Mapping of nodes .

12.  Delete CRS Record


1crsctl delete res ora.OCR.dg