Renamedg, a tool used to rename an Oracle asm disk group
Therenamedg
Tool enables you to change the name of a cloned disk group. The disk group must be dismounted on all nodes in the cluster before runningrenamedg
On the disk group.
renamedg
Renames a disk group using a two-step process:
Phase one
This phase generates a configuration file to be used in phase two.
Phase two
This phase uses the configuration file to perform the renaming of the disk group.
The syntax is:
renamedg
{-help
|help=true
}
renamedg
[phase
= {one
|two
|both
}]dgname=
diskgroup
newdgname=
newdiskgroup
[config=
configfile
]
[asm_diskstring=
discoverystring
,
discoverystring
...]
[clean=
{true
|false
}] [check=
{true
|false
}]
[confirm=
{true
|false
}] [verbose=
{true
|false
}]
[keep_voting_files=
{true
|false
}]
Note:
Applies: Oracle Server-Enterprise Edition-Version: 10.1.0.2 to 11.2.0.0 Information in this document applies to any platform.
Goal The purpose of this document is to provide information about rename diskgroup in 10g and 11gR1 release
Solution Rename diskgroup option is a new feature of 11gR2.
You can use this tool to rename your 10g or 11gR1 ASM diskgroup
You need to just install 11gR2 SIHA Grid Infrastructure software only installation.
Cd <11gr2 grid home>/bin Renamedg
Use renamedg tool to rename 10g or 11gR1 diskgroup.
Diskgroup cannot be renamed under following conditions:
-The Diskgroup is mounted -The Diskgroup is being used by CSS -Diskgroup contains offline disks |
Eg:
-Bash-4.1 $ sqlplus/as sysasm
SQL * Plus: Release 11.2.0.4.0 Production on Mon Mar 24 15:33:16 2014
Copyright (c) 1982,201 3, Oracle. All rights reserved.
Connected:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit Production
With the Automatic Storage Management option
SQL> alter diskgroup new_1_roup2 dismount;
Diskgroup altered.
SQL>
SQL>
SQL> exit
-Bash-4.1 $
-Bash-4.1 $ renamedg-help
NOTE: No asm libraries found in the system
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 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 execution,
(Verbose = TRUE | FALSE), default FALSE
Keep_voting_files Voting file attribute,
(Keep_voting_files = TRUE | FALSE), default FALSE
-Bash-4.1 $ renamedg dgname = new_javasroup2 newdgname = role roup2 asm_diskstring = '/dev/oracleasm/disks/*' verbose = true
NOTE: No asm libraries found in the system
Parsing parameters ..
Parameters in effect:
Old DG name: new_1_roup2
New DG name: Primary roup2
Phases:
Phase 1
Phase 2
Discovery str:/dev/oracleasm/disks /*
Clean: TRUE
Raw only: TRUE
Renamedg operation: dgname = new_initroup2 newdgname = datagroup2 asm_diskstring =/dev/oracleasm/disks/* verbose = true
Executing phase 1
Discovering the group
Discovery with string:/dev/oracleasm/disks /*
Identified disk UFS:/dev/oracleasm/disks/ASMDISK5 with disk number: 0 and timestamp (33001227 75905024)
Identified disk UFS:/dev/oracleasm/disks/ASMDISK6 with disk number: 1 and timestamp (33001227 75905024)
Identified disk UFS:/dev/oracleasm/disks/ASMDISK7 with disk number: 2 and timestamp (33001227 75905024)
Identified disk UFS:/dev/oracleasm/disks/ASMDISK8 with disk number: 5 and timestamp (33001229-598404096)
Identified disk UFS:/dev/oracleasm/disks/ASMDISK9 with disk number: 3 and timestamp (33001229-678575104)
Identified disk UFS:/dev/oracleasm/disks/ASMDISK10 with disk number: 4 and timestamp (33001229-678575104)
Checking for hearbeat...
Re-discovering the group
Discovery with string:/dev/oracleasm/disks /*
Identified disk UFS:/dev/oracleasm/disks/ASMDISK5 with disk number: 0 and timestamp (33001227 75905024)
Identified disk UFS:/dev/oracleasm/disks/ASMDISK6 with disk number: 1 and timestamp (33001227 75905024)
Identified disk UFS:/dev/oracleasm/disks/ASMDISK7 with disk number: 2 and timestamp (33001227 75905024)
Identified disk UFS:/dev/oracleasm/disks/ASMDISK8 with disk number: 5 and timestamp (33001229-598404096)
Identified disk UFS:/dev/oracleasm/disks/ASMDISK9 with disk number: 3 and timestamp (33001229-678575104)
Identified disk UFS:/dev/oracleasm/disks/ASMDISK10 with disk number: 4 and timestamp (33001229-678575104)
Checking if the diskgroup is mounted or used by CSS
Checking disk number: 0
Checking disk number: 1
Checking disk number: 2
Checking disk number: 5
Checking disk number: 3
Checking disk number: 4
Generating configuration file ..
Completed phase 1
Executing phase 2
Looking for/dev/oracleasm/disks/ASMDISK5
Modifying the header
Looking for/dev/oracleasm/disks/ASMDISK6
Modifying the header
Looking for/dev/oracleasm/disks/ASMDISK7
Modifying the header
Looking for/dev/oracleasm/disks/ASMDISK8
Modifying the header
Looking for/dev/oracleasm/disks/ASMDISK9
Modifying the header
Looking for/dev/oracleasm/disks/ASMDISK10
Modifying the header
Completed phase 2
Terminating kgfd context 0x7f57a424b0a0
-Bash-4.1 $ sqlplus/as sysasm
SQL * Plus: Release 11.2.0.4.0 Production on Mon Mar 24 15:35:04 2014
Copyright (c) 1982,201 3, Oracle. All rights reserved.
Connected:
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit Production
With the Automatic Storage Management option
SQL> select name, state from v $ asm_diskgroup;
NAME STATE
-----------------------------------------
DATAGROUP1 MOUNTED
DATAGROUP2 DISMOUNTED
SQL> alter diskgroup limit roup2 mount;
Diskgroup altered.
SQL> select name, state from v $ asm_diskgroup;
NAME STATE
-----------------------------------------
DATAGROUP1 MOUNTED
DATAGROUP2 MOUNTED
SQL> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0-64bit Production
With the Automatic Storage Management option
-Bash-4.1 $ crsctl stat res-t
--------------------------------------------------------------------------------
Name target state server STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
Ora. DATAGROUP1.dg
ONLINE oracle-one
Ora. DATAGROUP2.dg
ONLINE oracle-one
Ora. LISTENER. lsnr
ONLINE oracle-one
Ora. new_rouroup2.dg
OFFLINE oracle-one
Ora. asm
ONLINE oracle-one Started
Ora. ons
OFFLINE oracle-one
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
Ora.css d
1 ONLINE oracle-one
Ora. diskmon
1 OFFLINE
Ora. evmd
1 ONLINE oracle-one
Ora. rhys. db
1 OFFLINE Instance Shutdown
-Bash-4.1 $ srvctl remove diskgroup-g new_1_roup2
-Bash-4.1 $ crsctl status res-t
--------------------------------------------------------------------------------
Name target state server STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
Ora. DATAGROUP1.dg
ONLINE oracle-one
Ora. DATAGROUP2.dg
ONLINE oracle-one
Ora. LISTENER. lsnr
ONLINE oracle-one
Ora. asm
ONLINE oracle-one Started
Ora. ons
OFFLINE oracle-one
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
Ora.css d
1 ONLINE oracle-one
Ora. diskmon
1 OFFLINE
Ora. evmd
1 ONLINE oracle-one
Ora. rhys. db
1 OFFLINE Instance Shutdown