Friday, March 6, 2015


Because of SVM (Server Volume Manager Migration) we have been asked to change our entire storage to different Volume.  In this case volume has already been migrated and mapped across all DB Servers.  Here we need to migrate VOTING DISK and OCR to newly created Diskgroup.

SQL> conn / as sysasm

SQL> select name,COMPATIBILITY ,DATABASE_COMPATIBILITY
from V$ASM_DISKGROUP
where name='DG_DATA';

NAME       COMPATIBILITY    DATABASE_COMPATIBILITY
--------   ---------------- --------------------------
DG_DATA    10.1.0.0.0       10.1.0.0.0

In case it is not, then you can change it using following command

SQL> conn / as sysasm

SQL> alter diskgroup DG_DATA SET ATTRIBUTE 'compatible.asm'='11.2';


3) Replace voting disk using CRSCTL command as oracle user. You can do this without stopping the clusterware


$ crsctl replace votedisk +DG_DATA

Successful addition of voting disk 741ba1e0c11w3fd37b3405036d514e9.
Successful deletion of voting disk 92bfaca4afb4fe9bbfaca4ab4340503.
Successfully replaced voting disk group with +DG_DATA.
CRS-4266: Voting file(s) successfully replaced

To list the voting disk

crsctl query css votedisk

##  STATE    File Universal Id                File Name Disk group
--  -----    ---------------                --------- ---------
 1. ONLINE   92bfaca4afb4fe9bbfaca4ab4340503 (ORCL:ASM_DISK04) [DG_DATA_NEW]
Located 1 voting disk(s).

4) To replace OCR, we need to have multiple OCR configured. In our case we need to add OCR to new diskgroup and delete old one. We need to run this command as privilege user (root).

# ocrconfig -add +DG_DATA

# ocrcheck

Status of Oracle Cluster Registry is as follows :
    Version                  :          3
    Total space (kbytes)     :     262120
    Used space (kbytes)      :       2424
    Available space (kbytes) :     259696
    ID                       :  579998313
    Device/File Name         :      +DG_DATA
                                    Device/File integrity check succeeded
    Device/File Name         : +DG_DATA_NEW
                                    Device/File integrity check succeeded

                                    Device/File not configured

                                    Device/File not configured

                                    Device/File not configured

    Cluster registry integrity check succeeded

    Logical corruption check succeeded
  
Removing OCR existing DISKGROUP  

[root ~]# ocrconfig -delete +DG_DATA

[root ~]# ocrcheck

Status of Oracle Cluster Registry is as follows :
    Version                  :          3
    Total space (kbytes)     :     262120
    Used space (kbytes)      :       2424
    Available space (kbytes) :     259696
    ID                       :  579998313
    Device/File Name         : +DG_DATA_NEW
                                    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
Verify that OCR location is pointing to the correct diksgroup on both nodes.

# cat /etc/oracle/ocr.loc

#Device/file +DG_DATA getting replaced by device +DG_DATA_NEW
ocrconfig_loc=+DG_DATA_NEW
local_only=false

5) ASM Parameter file is also present in same diskgroup. In case you wish to remove it, then follow below steps

SQL> create pfile from spfile;

File created.

SQL> create spfile='+DG_DATA_NEW' from pfile;

File created.

You will need to restart the cluster on both the nodes as ASM instance is still using the file. Run following commands on both the nodes
crsctl stop cluster
crsctl start cluster

For Database Diskgroup migration, we can do by RENAME DATAFILE or RMAN Backup restore to New DG.
Now we can easily remove OLD DISKGROUP ( +DG_DATA)



No comments:

Post a Comment