As of Oracle Database 11g Release 2, we can now rename disk groups. Why is this important? There’s two great reason why I think this feature is really beneficial for lot of companies. First, companies who leverage hardware mirroring or triple mirroring technologies such as EMC Business Continuity Volumes (BCV) or Hitachi Shadow Image (SI) can really benefit from this. Companies can now break their BCV or SI and rename their disk group where they have their production database and mount it again as another diskgroup. This way they can stand up another copy of their production database on the same physical server with minimal effort.
Note:
1. As of the initial release of Oracle Database 11g Release 2, the disk group rename feature does not handle the remaining task of standing up another database. You still have to re-catalog all the database files with the renamed disk group name. Additionally, you will have to create a new DB ID (nid).
2. If your company happens to have standardized disk group names with easily identifiable names such as as DATA, FLASH, LOBDATA, or FRA, you may have the same disk group names in Production, Staging, DEV and even disaster recovery site. For example, you can zone your production BCV or SI disks to your staging/Pre-Production/Model servers, rename the disk group called DATA to STAGE_DATA, and stand up the database from your BCV/SI.
Likewise, if you built disk groups with intelligent naming schemes (being a forward thinking architect
), you may now choose to create easily identifiable disk group names such as DATA, FLASH, FRA, LOBDATA, etc.
Let’s look at the process of renaming a disk group. In order to rename a disk group, the disk group must be disounted across all the RAC nodes:
ASMCMD> umount dg_external
ASMCMD> umount fra
You can rename a disk group in one of two ways. The first option (default) renames the disk group in a single command. In our example, we will also specify the verbose mode for additional details in the output. The second option will create a configuration file at the end of phase one and will use the configuration file to complete the rename disk group operation.
Option #1 – Phase=Both:
The default phase is both.
[oracle@jin1 ~]$ renamedg dgname=fra newdgname=flash verbose=true
Parsing parameters..
Parameters in effect:
Old DG name : FRA
New DG name : FLASH
Phases :
Phase 1
Phase 2
Discovery str : (null)
Clean : TRUE
Raw only : TRUE
renamedg operation: dgname=fra newdgname=flash verbose=true
Executing phase 1
Discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:FRA1 with disk number:0 and timestamp (32924850 209876992)
Checking for hearbeat...
Re-discovering the group
Performing discovery with string:
Identified disk ASM:/opt/oracle/extapi/32/asm/orcl/1/libasm.so:ORCL:FRA1 with disk number:0 and timestamp (32924850 209876992)
Checking if the diskgroup is mounted
Checking disk number:0
Checking if diskgroup is used by CSS
Generating configuration file..
Completed phase 1
Executing phase 2
Looking for ORCL:FRA1
Modifying the header
Completed phase 2
Terminating kgfd context 0xb7f2c050
Let’s mount the renamed disk group:
[oracle@jin1 ~]$ asmcmd mount flash
[oracle@jin1 ~]$ asmcmd lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 23460 13140 0 13140 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 42068 42016 0 42016 0 N FLASH/
MOUNTED EXTERN N 512 4096 1048576 45792 41631 0 41631 0 N LOBDATA/
Option #2 – Phase 1 followed by Phase 2:
This option basically involves two steps to renaming a disk group. The first step, referred to as phase one, generates a configuration file. The config file has line item entries for each disk with changes to be made. The second step called phase two uses the generated config file to perform the rename function.
Another important information to note is that the renamedg command is an OS utility (not an asmcmd command). if you type renamedg with the -help option, you can get the complete syntax:
[oracle@jin1 ~]$ renamedg -help
Parsing parameters..
phase Phase to execute,
(phase=ONE|TWO|BOTH), default BOTH
dgname Diskgroup to be renamed
newdgname New name for the diskgroup
config intermediate config file
check just check-do not perform actual operation,
(check=TRUE/FALSE), default FALSE
confirm confirm before committing changes to disks,
(confirm=TRUE/FALSE), default FALSE
clean ignore errors,
(clean=TRUE/FALSE), default TRUE
asm_diskstring ASM Diskstring (asm_diskstring='discoverystring',
'discoverystring1' ...)
verbose verbose execution,
(verbose=TRUE|FALSE), default FALSE
keep_voting_files Voting file attribute,
(keep_voting_files=TRUE|FALSE), default FALSE
Let’s start the process, phase one, by creating our configuration file:
[oracle@jin1 ~]$ renamedg -phase one -dgname dg_external -newdgname lobdata -config rename_dg_external_2.conf
Parsing parameters..
renamedg operation: -phase one -dgname dg_external -newdgname lobdata -config rename_dg_external_2.conf
Executing phase 1
Discovering the group
Checking for hearbeat...
Re-discovering the group
Generating configuration file..
Completed phase 1
The configuration file rename_dg_external_2.conf looks like this:
[oracle@jin1 ~]$ cat rename_dg_external_2.conf
ORCL:HIGH1 DG_EXTERNAL LOBDATA
ORCL:HIGH2 DG_EXTERNAL LOBDATA
ORCL:HIGH3 DG_EXTERNAL LOBDATA
Now, let’s apply the configuration file and rename our diskgroup from DG_EXTERNAL to LOBDATA:
[oracle@jin1 ~]$ renamedg -phase two -dgname dg_external -newdgname lobdata -config rename_dg_external_2.conf
Parsing parameters..
renamedg operation: -phase two -dgname dg_external -newdgname lobdata -config rename_dg_external_2.conf
Executing phase 2
Completed phase 2
We should now be able to mount the renamed LOBDATA disk group with asmcmd:
[oracle@jin1 ~]$ asmcmd
ASMCMD> mount lobdata
With the lsdg asmcmd command, you can verify that the LOBDATA disk group is truly mounted:
ASMCMD> lsdg
State Type Rebal Sector Block AU Total_MB Free_MB Req_mir_free_MB Usable_file_MB Offline_disks Voting_files Name
MOUNTED EXTERN N 512 4096 1048576 15640 5332 0 5332 0 N DATA/
MOUNTED EXTERN N 512 4096 1048576 45792 45736 0 45736 0 N LOBDATA/
Posted by Charles Kim, Oracle ACE