A technical troubleshooting blog about Oracle with other Databases & Cloud Technologies.

How to Rename ASM Diskgroup ??

4 min read

Hey Folks,

Today I faced an issue while configuring Oracle DR setup which was due to different diskgroup present in primary (DGDATA) and standby (DATA).

While running Active duplicate command in standby it was throwing below error:

RMAN > duplicate target database for standby from active database dorecover spfile set db_unique_name='CERTDBS2' comment 'Is Standby' set local_listener='(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.01)(PORT=1521))' nofilenamecheck;
--
--
--
duplicating Online logs to Oracle Managed File (OMF) location
duplicating Datafiles to Oracle Managed File (OMF) location
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of Duplicate Db command at 09/06/2024 14:18:03
RMAN-05501: aborting duplication of target database
RMAN-06136: Oracle error from auxiliary database: ORA-00200: control file could not be created
ORA-00202: control file: '+DGDATA'
ORA-17502: ksfdcre:4 Failed to create file +DGDATA
ORA-15001: diskgroup "DGDATA" does not exist or is not mounted
ORA-15018: diskgroup cannot be created
ORA-15001: diskgroup "DGDATA" does not exist or is not mounted

Therefore I tried to rename diskgroup in standby same as primary.

Rename : DATA to DGDATA

Check the cluster Services:

[grid@localhost ~]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       localhost            STABLE
ora.LISTENER.lsnr
               ONLINE  ONLINE       localhost            STABLE
ora.REDO.dg
               ONLINE  ONLINE       localhost            STABLE
ora.asm
               ONLINE  ONLINE       localhost            Started,STABLE
ora.ons
               OFFLINE OFFLINE      localhost            STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.cssd
      1        ONLINE  ONLINE       localhost            STABLE
ora.diskmon
      1        OFFLINE OFFLINE                               STABLE
ora.evmd
      1        ONLINE  ONLINE       localhost            STABLE

Check for Diskgroup which are mounted:

[grid@localhost ~]$ crsctl stat res -t -w "TYPE = ora.diskgroup.type"
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               ONLINE  ONLINE       localhost            STABLE
ora.REDO.dg
               ONLINE  ONLINE       localhost            STABLE
--------------------------------------------------------------------------------

Check Status of Diskgroup:

[grid@localhost ~]$ asmcmd lsdg -g

Inst_ID  State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
      1  MOUNTED  EXTERN  N         512             512   4096  4194304    697340   697236                0          697236              0             N  DATA/
      1  MOUNTED  EXTERN  N         512             512   4096  4194304    102396   102300                0          102300              0             N  REDO/

Disable Has/CRS Services:

[grid@localhost ~]$ crsctl disable has
CRS-4621: Oracle High Availability Services autostart is disabled.

Unmount the Diskgroup which you want to rename it:

[grid@localhost ~]$ asmcmd umount DATA
ORA-15032: not all alterations performed
ORA-15027: active use of diskgroup "DATA" precludes its dismount (DBD ERROR: OCIStmtExecute)


[grid@localhost ~]$ asmcmd umount DATA -f

Check for Diskgroup Status (Offline):

[grid@localhost ~]$  crsctl stat res -t -w "TYPE = ora.diskgroup.type"
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               OFFLINE OFFLINE      localhost            STABLE
ora.REDO.dg
               OFFLINE OFFLINE      localhost            STABLE
--------------------------------------------------------------------------------
[grid@localhost ~]$

Rename the Diskgroup (From DATA to DGDATA):

[grid@localhost ~]$ renamedg dgname=DATA newdgname=DGDATA verbose=true

Parameters in effect:

         Old DG name       : DATA
         New DG name          : DGDATA
         Phases               :
                 Phase 1
                 Phase 2
         Discovery str        : (null)
         Clean              : TRUE
         Raw only           : TRUE
renamedg operation: dgname=DATA newdgname=DGDATA verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
ERROR: submiting READ on /dev/sda failed due to kgfknm error
ERROR: -20(27041 /dev/sda)ERROR: submiting READ on /dev/sda1 failed due to kgfknm error
ERROR: -20(27041 /dev/sda1)ERROR: submiting READ on /dev/sda2 failed due to kgfknm error
ERROR: -20(27041 /dev/sda2)ERROR: submiting READ on /dev/sda3 failed due to kgfknm error
ERROR: -20(27041 /dev/sda3)ERROR: submiting READ on /dev/sdb failed due to kgfknm error
ERROR: -20(27041 /dev/sdb)ERROR: submiting READ on /dev/sdc failed due to kgfknm error
ERROR: -20(27041 /dev/sdc)ERROR: submiting READ on /dev/sdc1 failed due to kgfknm error
ERROR: -20(27041 /dev/sdc1)ERROR: submiting READ on /dev/sdd failed due to kgfknm error
ERROR: -20(27041 /dev/sdd)Identified disk UFS:/dev/sdd1 with disk number:0 and timestamp (33170326 1992231936)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
ERROR: submiting READ on /dev/sda failed due to kgfknm error
ERROR: -20(27041 /dev/sda)ERROR: submiting READ on /dev/sda1 failed due to kgfknm error
ERROR: -20(27041 /dev/sda1)ERROR: submiting READ on /dev/sda2 failed due to kgfknm error
ERROR: -20(27041 /dev/sda2)ERROR: submiting READ on /dev/sda3 failed due to kgfknm error
ERROR: -20(27041 /dev/sda3)ERROR: submiting READ on /dev/sdb failed due to kgfknm error
ERROR: -20(27041 /dev/sdb)ERROR: submiting READ on /dev/sdc failed due to kgfknm error
ERROR: -20(27041 /dev/sdc)ERROR: submiting READ on /dev/sdc1 failed due to kgfknm error
ERROR: -20(27041 /dev/sdc1)ERROR: submiting READ on /dev/sdd failed due to kgfknm error
ERROR: -20(27041 /dev/sdd)Identified disk UFS:/dev/sdd1 with disk number:0 and timestamp (33170326 1992231936)
Checking if the diskgroup is mounted or used by CSS
Checking disk number:0
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for /dev/sdd1
Pre-image dump of header : /dev/sdd1
kfbh.endian:                          1 ; 0x000: 0x01

kfbh.hard:                          130 ; 0x001: 0x82

kfbh.type:                            1 ; 0x002: KFBTYP_DISKHEAD

kfbh.datfmt:                          1 ; 0x003: 0x01

kfbh.block.blk:                       0 ; 0x004: blk=0
--
--
--

kfdhdb.acdb.aba.blk:                  0 ; 0x1d8: 0x00000000

kfdhdb.acdb.ents:                     0 ; 0x1dc: 0x0000

kfdhdb.acdb.ub2spare:                 0 ; 0x1de: 0x0000

Modifying the header
Completed phase 2
[grid@localhost ~]$

Once Rename is completed, mount the Diskgroup & Check the services (Online):

[grid@localhost ~]$ asmcmd mount DGDATA
[grid@localhost ~]$ crsctl stat res -t -w "TYPE = ora.diskgroup.type"
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA.dg
               OFFLINE OFFLINE      localhost            STABLE
ora.DGDATA.dg
               ONLINE  ONLINE       localhost            STABLE
ora.DGREDO.dg
               ONLINE  ONLINE       localhost            STABLE
ora.REDO.dg
               OFFLINE OFFLINE      localhost            STABLE
--------------------------------------------------------------------------------

Remove the old diskgroup:

[grid@localhost ~]$ srvctl remove diskgroup -g DATA

Hope it helped !! 🙂