Category - ASM

Renaming ASM Diskgroup in Oracle RAC 19c

How to Rename ASM Diskgroup in Oracle RAC 19c.

In this practice we will be renaming diskgroup from DATA to DATA_REP and FRA to FRA_RECO as per below method.

Step 1=> Check Diskgroup status as below (O/P trimmed)

[grid@racnoden1 ~]$ /grid_home/app/19c/grid/bin/crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources

ora.DATA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        OFFLINE OFFLINE                                      STABLE
ora.FRA.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        OFFLINE OFFLINE                                      STABLE

ora.dbset.db
      1        OFFLINE OFFLINE                               Instance Shutdown,STABLE
      2        OFFLINE OFFLINE                               Instance Shutdown,STABLE

ora.test.db
      1        OFFLINE OFFLINE                               STABLE
--------------------------------------------------------------------------------

Step 2=> Unmount DATA and FRA diskgroup from ALL NODES

[grid@racnoden1 ~]$ asmcmd

ASMCMD> umount DATA
ASMCMD> lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     20476    16804                0           16804              0             N  FRA/
MOUNTED  EXTERN  N         512             512   4096  4194304     30716    30352                0           30352              0             Y  OCR/
ASMCMD> umount FRA
ASMCMD> lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     30716    30352                0           30352              0             Y  OCR/
ASMCMD>
ASMCMD>
ASMCMD> exit

[grid@racnoden2 ~]$
[grid@racnoden2 ~]$ ps -eaf |grep pmon
grid      4575     1  0 19:52 ?        00:00:00 asm_pmon_+ASM2
grid      6848  6782  0 20:30 pts/0    00:00:00 grep --color=auto pmon
[grid@racnoden2 ~]$ asmcmd
ASMCMD> umount DATA
ASMCMD> umount FRA
ASMCMD> ls
OCR/
ASMCMD> lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     30716    30352                0           30352              0             Y  OCR/
ASMCMD> exit
[grid@racnoden2 ~]$ logout
Connection to racnoden2 closed.

Step 3=> Check if RENAME is possible using below command and MUST to include CHECK=TRUE .

[grid@racnoden1 ~]$ renamedg dgname=DATA newdgname=DATA_REP asm_diskstring='/dev/oracleasm/disks/*' verbose=true CHECK=TRUE

Parameters in effect:

      Old DG name       : DATA
     New DG name          : DATA_REP
     Phases               :
          Phase 1
          Phase 2
     Discovery str        : /dev/oracleasm/disks/*
     Check              : TRUE
     Clean              : TRUE
     Raw only           : TRUE
renamedg operation: dgname=DATA newdgname=DATA_REP asm_diskstring=/dev/oracleasm/disks/* verbose=true CHECK=TRUE
Executing phase 1
Discovering the group
Performing discovery with string:/dev/oracleasm/disks/*
Identified disk UFS:/dev/oracleasm/disks/DATA with disk number:0 and timestamp (33134964 -1763073024)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:/dev/oracleasm/disks/*
Identified disk UFS:/dev/oracleasm/disks/DATA with disk number:0 and timestamp (33134964 -1763073024)
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/oracleasm/disks/DATA
Leaving the header unchanged
Completed phase 2

Step 4 => Perform Actual Diskgroup Rename operation as below.

[grid@racnoden1 ~]$ renamedg dgname=DATA newdgname=DATA_REP asm_diskstring='/dev/oracleasm/disks/*' verbose=true

Parameters in effect:

      Old DG name       : DATA
     New DG name          : DATA_REP
     Phases               :
          Phase 1
          Phase 2
     Discovery str        : /dev/oracleasm/disks/*
     Clean              : TRUE
     Raw only           : TRUE
renamedg operation: dgname=DATA newdgname=DATA_REP asm_diskstring=/dev/oracleasm/disks/* verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:/dev/oracleasm/disks/*
Identified disk UFS:/dev/oracleasm/disks/DATA with disk number:0 and timestamp (33134964 -1763073024)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:/dev/oracleasm/disks/*
Identified disk UFS:/dev/oracleasm/disks/DATA with disk number:0 and timestamp (33134964 -1763073024)
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/oracleasm/disks/DATA
Modifying the header
Completed phase 2

[grid@racnoden1 ~]$ renamedg dgname=FRA newdgname=FRA_RECO asm_diskstring='/dev/oracleasm/disks/*' verbose=true

Parameters in effect:

      Old DG name       : FRA
     New DG name          : FRA_RECO
     Phases               :
          Phase 1
          Phase 2
     Discovery str        : /dev/oracleasm/disks/*
     Clean              : TRUE
     Raw only           : TRUE
renamedg operation: dgname=FRA newdgname=FRA_RECO asm_diskstring=/dev/oracleasm/disks/* verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:/dev/oracleasm/disks/*
Identified disk UFS:/dev/oracleasm/disks/FRA with disk number:0 and timestamp (33134964 -1730529280)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:/dev/oracleasm/disks/*
Identified disk UFS:/dev/oracleasm/disks/FRA with disk number:0 and timestamp (33134964 -1730529280)
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/oracleasm/disks/FRA
Modifying the header
Completed phase 2

Step 5=> Mount Diskgroup on Both nodes as below

[grid@racnoden1 ~]$ asmcmd
ASMCMD> lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     30716    30352                0           30352              0             Y  OCR/
ASMCMD>
ASMCMD>
ASMCMD> mount DATA_REP
ASMCMD> mount FRA_RECO
ASMCMD> lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     30716    25632                0           25632              0             N  DATA_REP/
MOUNTED  EXTERN  N         512             512   4096  4194304     20476    16804                0           16804              0             N  FRA_RECO/
MOUNTED  EXTERN  N         512             512   4096  4194304     30716    30352                0           30352              0             Y  OCR/
ASMCMD> exit

[grid@racnoden1 ~]$
[grid@racnoden1 ~]$ ssh grid@racnoden2
[grid@racnoden2 ~]$
[grid@racnoden2 ~]$ asmcmd
ASMCMD> lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     30716    30352                0           30352              0             Y  OCR/

ASMCMD> mount DATA_REP
ASMCMD> mount FRA_RECO
ASMCMD> lsdg
State    Type    Rebal  Sector  Logical_Sector  Block       AU  Total_MB  Free_MB  Req_mir_free_MB  Usable_file_MB  Offline_disks  Voting_files  Name
MOUNTED  EXTERN  N         512             512   4096  4194304     30716    25632                0           25632              0             N  DATA_REP/
MOUNTED  EXTERN  N         512             512   4096  4194304     20476    16804                0           16804              0             N  FRA_RECO/
MOUNTED  EXTERN  N         512             512   4096  4194304     30716    30352                0           30352              0             Y  OCR/
ASMCMD> exit
[grid@racnoden2 ~]$

Step 6=> Check resource for Newly renamed DG as below (O/P Trimmed).

[grid@racnoden2 ~]$ /grid_home/app/19c/grid/bin/crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------

ora.DATA.dg(ora.asmgroup)
      1        OFFLINE OFFLINE                               STABLE
      2        OFFLINE OFFLINE                               STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.DATA_REP.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.FRA.dg(ora.asmgroup)
      1        OFFLINE OFFLINE                               STABLE
      2        OFFLINE OFFLINE                               STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.FRA_RECO.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        OFFLINE OFFLINE                               STABLE

ora.dbset.db
      1        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE
      2        OFFLINE OFFLINE                               Instance Shutdown,ST
                                                             ABLE

ora.test.db
      1        OFFLINE OFFLINE                               STABLE
--------------------------------------------------------------------------------

Step 7=> We will try to remove DATA and FRA from Cluster resources ,But getting error as this is being used.

[grid@racnoden2 ~]$ srvctl remove diskgroup -g DATA
PRCA-1002 : Failed to remove CRS resource ora.DATA.dg for ASM Disk Group DATA
PRCR-1028 : Failed to remove resource ora.DATA.dg
PRCR-1072 : Failed to unregister resource ora.DATA.dg
CRS-2730: Resource 'ora.dbset.db' depends on resource 'ora.DATA.dg'

Switch to DB owner and remove DB instance and then DELETE DG as below.

[oracle@racnoden1 ~]$ srvctl remove database -d DBSET
Remove the database DBSET? (y/[n]) y
[oracle@racnoden1 ~]$ srvctl remove database -d TEST
Remove the database TEST? (y/[n]) y
[oracle@racnoden1 ~]$
[oracle@racnoden1 ~]$ /grid_home/app/19c/grid/bin/crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------

ora.DATA.dg(ora.asmgroup)
      1        OFFLINE OFFLINE                               STABLE
      2        OFFLINE OFFLINE                               STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.DATA_REP.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.FRA.dg(ora.asmgroup)
      1        OFFLINE OFFLINE                               STABLE
      2        OFFLINE OFFLINE                               STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.FRA_RECO.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       racnoden1                STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       racnoden2                STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       racnoden2                STABLE
ora.OCR.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                Started,STABLE
      2        ONLINE  ONLINE       racnoden2                Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       racnoden2                STABLE
ora.qosmserver
      1        ONLINE  ONLINE       racnoden2                STABLE
ora.racnoden1.vip
      1        ONLINE  ONLINE       racnoden1                STABLE
ora.racnoden2.vip
      1        ONLINE  ONLINE       racnoden2                STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       racnoden1                STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       racnoden2                STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       racnoden2                STABLE
--------------------------------------------------------------------------------

[grid@racnoden1 ~]$ crsctl check cluster -all
**************************************************************
racnoden1:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************
racnoden2:
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
**************************************************************

Step 8 => We will to remove DATA and FRA from Cluster resources ,FInally koay now.

[grid@racnoden2 ~]$ srvctl remove diskgroup -g DATA
[grid@racnoden2 ~]$ srvctl remove diskgroup -g FRA
[grid@racnoden2 ~]$  /grid_home/app/19c/grid/bin/crsctl stat res -t
--------------------------------------------------------------------------------
Name           Target  State        Server                   State details       
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.LISTENER.lsnr
               ONLINE  ONLINE       racnoden1                STABLE
               ONLINE  ONLINE       racnoden2                STABLE
ora.chad
               ONLINE  ONLINE       racnoden1                STABLE
               ONLINE  ONLINE       racnoden2                STABLE
ora.net1.network
               ONLINE  ONLINE       racnoden1                STABLE
               ONLINE  ONLINE       racnoden2                STABLE
ora.ons
               ONLINE  ONLINE       racnoden1                STABLE
               ONLINE  ONLINE       racnoden2                STABLE
ora.proxy_advm
               OFFLINE OFFLINE      racnoden1                STABLE
               OFFLINE OFFLINE      racnoden2                STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.ASMNET1LSNR_ASM.lsnr(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        ONLINE  OFFLINE                               STABLE
ora.DATA_REP.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.FRA_RECO.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.LISTENER_SCAN1.lsnr
      1        ONLINE  ONLINE       racnoden1                STABLE
ora.LISTENER_SCAN2.lsnr
      1        ONLINE  ONLINE       racnoden2                STABLE
ora.LISTENER_SCAN3.lsnr
      1        ONLINE  ONLINE       racnoden2                STABLE
ora.OCR.dg(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asm(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                Started,STABLE
      2        ONLINE  ONLINE       racnoden2                Started,STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.asmnet1.asmnetwork(ora.asmgroup)
      1        ONLINE  ONLINE       racnoden1                STABLE
      2        ONLINE  ONLINE       racnoden2                STABLE
      3        OFFLINE OFFLINE                               STABLE
ora.cvu
      1        ONLINE  ONLINE       racnoden2                STABLE
ora.qosmserver
      1        ONLINE  ONLINE       racnoden2                STABLE
ora.racnoden1.vip
      1        ONLINE  ONLINE       racnoden1                STABLE
ora.racnoden2.vip
      1        ONLINE  ONLINE       racnoden2                STABLE
ora.scan1.vip
      1        ONLINE  ONLINE       racnoden1                STABLE
ora.scan2.vip
      1        ONLINE  ONLINE       racnoden2                STABLE
ora.scan3.vip
      1        ONLINE  ONLINE       racnoden2                STABLE
--------------------------------------------------------------------------------
[grid@racnoden2 ~]$