DOYENSYS Knowledge Portal




We Welcome you to visit our DOYENSYS KNOWLEDGE PORTAL : Doyensys Knowledge Portal




Monday, June 25, 2018

 Renaming ASM DiskGroup in 11gR2



In Oracle 11gR2, we can use new utility RENAMEDG to rename the ASM disk group. 
This tool works in 2 phases. 
In first phase it generates a configuration file and in 
2nd phase it discover the disk and rename the diskgroup.

Below are the steps to rename an ASM disk group:

Set the oracle environment to ASM instance


 [oracle@ovm-HPSEB RMAN]$ . oraenv

ORACLE_SID = [HPSEB] ? +ASM
The Oracle base remains unchanged with value /u01/app/oracle

Check the available diskgroups

[oracle@ovm-HPSEB RMAN]$ asmcmd
ASMCMD> ls
DATA/
RECO/

List the ASM disks status:

ASMCMD> lsdsk
Path
ORCL:ASM_DATA1
ORCL:ASM_REC1


Check the current disk stats :

[oracle@ovm-HPSEB RMAN]$ sqlplus / as sysasm

SQL*Plus: Release 11.2.0.4.0 Production on Wed May 28 11:20:07 2018

Copyright (c) 1982, 2013, Oracle.  All rights reserved.


Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production
With the Automatic Storage Management option

SQL> select group_number, name, TOTAL_MB, FREE_MB from V$asm_disk_stat;

GROUP_NUMBER NAME                             TOTAL_MB    FREE_MB
------------ ------------------------------          ----------         ----------
           1 ASM_DATA1                                     25600              20292
           2 ASM_REC1                                        25600              25550

Dis-mount the Diskgroup needs to be renamed (In case of cluster, dismount from all nodes)

ASMCMD> ls
DATA/
RECO/

ASMCMD> umount RECO

ASMCMD> ls
DATA/

Note:  In case of Cluster, verify the diskgroup is dismounted

$ crsctl status resource ora.RECO.dg

NAME=ora.RECO.dg
TYPE=ora.diskgroup.type
TARGET=OFFLINE, OFFLINE
STATE=OFFLINE, OFFLINE

Use renamedg command to rename the dismounted ASM diskgroup:

[oracle@ovm-HPSEB RMAN]$ renamedg phase=both dgname=RECO newdgname=REC verbose=true

Parsing parameters..

Parameters in effect:

         Old DG name       : RECO
         New DG name          : REC
         Phases               :
                 Phase 1
                 Phase 2
         Discovery str        : (null)
         Clean              : TRUE
         Raw only           : TRUE
renamedg operation: phase=both dgname=RECO newdgname=REC verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:ASM_REC1 with disk number:0 and timestamp (33002988 -959425536)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/64/asm/orcl/1/libasm.so:ORCL:ASM_REC1 with disk number:0 and timestamp (33002988 -959425536)
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 ORCL:ASM_REC1
Modifying the header
Completed phase 2
Terminating kgfd context 0x7f42391990a0

Mount the renamed diskgroup with new name:

[oracle@ovm-HPSEB RMAN]$ asmcmd mount REC
[oracle@ovm-HPSEB RMAN]$ asmcmd
ASMCMD> ls
DATA/
REC/

No comments: