Examples of rename ASM DiskGroup in Oracle

Source: Internet
Author: User
Tags dba oracle database

After 11.2, you can rename ASM DiskGroup without having to create a new diskgroup, and then do image copy.

In 11.2, in the GI home, with a command renamedg, look at the following example:

RENAMEDG phase=<both|one|two> dgname=<old_diskgroup_name> newdgname=<new_diskgroup_name> [asm_ Diskstring= ' <path_name> '] [verbose=true]
The steps can be divided into 2 phase, the first is to generate a configure file (Renamedg_config), and the second phase is to execute the Configure file, and the Phase=both in the document is to indicate that the build is executed directly after it is finished.

In addition, in 10g and 11GR1 can also be modified, but in fact it is also the use of 11GR2 renamedg tools.

Note: In the operation of the time, stepped on a few pits, here and share with you.

(a) may need to set asm_diskstring, I did not add this parameter for the first time, the error KFNDG-00407:

[Oracle@rac1 ~]$ renamedg phase=both Dgname=fra Newdgname=new_fra


Note:no ASM Libraries found in the system





Parsing parameters.





Parameters in effect:





Old DG Name:fra


New DG Name:new_fra


Phases:


Phase 1


Phase 2


Discovery str: (NULL)


Clean:true


Raw Only:true


RENAMEDG Operation:phase=both Dgname=fra Newdgname=new_fra verbose=true


Executing Phase 1


Discovering the Group


Performing Discovery with string:


Kfndg-00407:file not found; Arguments: []





Terminating KGFD Context 0x7fd4b29520a0


[Oracle@rac1 ~]$


Note, the path where disk is located, you can refer to the ASM instance initialization parameter asm_diskstring settings, or directly with Kfod Disks=all can be seen.

(ii) The second time, add the asm_diskstring this parameter, but only before the operation only umount the Node1, forget Umount node2 DiskGroup, the error KFNDG-00305:

[Oracle@rac1 dev]$ renamedg phase=both dgname=fra newdgname=new_fra asm_diskstring= '/dev/asm* ' verbose=true


Note:no ASM Libraries found in the system





Parsing parameters.





Parameters in effect:





Old DG Name:fra


New DG Name:new_fra


Phases:


Phase 1


Phase 2


Discovery Str:/dev/asm*


Clean:true


Raw Only:true


RENAMEDG operation:phase=both Dgname=fra Newdgname=new_fra asm_diskstring=/dev/asm* verbose=true


Executing Phase 1


Discovering the Group


Performing Discovery with string:/dev/asm*


Identified disk UFS:/DEV/ASM-FRA03 with disk Number:2 and timestamp (33005975-1778129920)


Identified disk UFS:/DEV/ASM-FRA04 with disk Number:3 and timestamp (33005975-1778129920)


Identified disk UFS:/DEV/ASM-FRA01 with disk number:0 and timestamp (33005975-1778129920)


Identified disk UFS:/DEV/ASM-FRA02 with disk number:1 and timestamp (33005975-1778129920)


Checking for Hearbeat ...


Re-discovering the Group


Performing Discovery with string:/dev/asm*


Identified disk UFS:/DEV/ASM-FRA03 with disk Number:2 and timestamp (33005975-1778129920)


Identified disk UFS:/DEV/ASM-FRA04 with disk Number:3 and timestamp (33005975-1778129920)


Identified disk UFS:/DEV/ASM-FRA01 with disk number:0 and timestamp (33005975-1778129920)


Identified disk UFS:/DEV/ASM-FRA02 with disk number:1 and timestamp (33005975-1778129920)


Checking if the diskgroup is mounted or used by CSS


Checking Disk Number:2


Checking Disk Number:3


Checking Disk number:0


Checking Disk Number:1


Generating configuration file.


Kfndg-00305:file not found





Terminating KGFD Context 0x7f82d62960a0


[Oracle@rac1 dev]$


Solved the above 2 problems, is the normal modification success:

[Oracle@rac1 ~]$ renamedg phase=both dgname=fra newdgname=new_fra asm_diskstring= '/dev/asm* ' verbose=true


Note:no ASM Libraries found in the system





Parsing parameters.





Parameters in effect:





Old DG Name:fra


New DG Name:new_fra


Phases:


Phase 1


Phase 2


Discovery Str:/dev/asm*


Clean:true


Raw Only:true


RENAMEDG operation:phase=both Dgname=fra Newdgname=new_fra asm_diskstring=/dev/asm* verbose=true


Executing Phase 1


Discovering the Group


Performing Discovery with string:/dev/asm*


Identified disk UFS:/DEV/ASM-FRA03 with disk Number:2 and timestamp (33005975-1778129920)


Identified disk UFS:/DEV/ASM-FRA04 with disk Number:3 and timestamp (33005975-1778129920)


Identified disk UFS:/DEV/ASM-FRA01 with disk number:0 and timestamp (33005975-1778129920)


Identified disk UFS:/DEV/ASM-FRA02 with disk number:1 and timestamp (33005975-1778129920)


Checking for Hearbeat ...


Re-discovering the Group


Performing Discovery with string:/dev/asm*


Identified disk UFS:/DEV/ASM-FRA03 with disk Number:2 and timestamp (33005975-1778129920)


Identified disk UFS:/DEV/ASM-FRA04 with disk Number:3 and timestamp (33005975-1778129920)


Identified disk UFS:/DEV/ASM-FRA01 with disk number:0 and timestamp (33005975-1778129920)


Identified disk UFS:/DEV/ASM-FRA02 with disk number:1 and timestamp (33005975-1778129920)


Checking if the diskgroup is mounted or used by CSS


Checking Disk Number:2


Checking Disk Number:3


Checking Disk number:0


Checking Disk Number:1


Generating configuration file.


Completed Phase 1


Executing Phase 2


Looking for/dev/asm-fra03


Modifying the header


Looking for/dev/asm-fra04


Modifying the header


Looking for/dev/asm-fra01


Modifying the header


Looking for/dev/asm-fra02


Modifying the header


Completed Phase 2


Terminating KGFD Context 0x7fa4f29790a0


[Oracle@rac1 ~]$


Look at the log above, it seems to be locking the corresponding DiskGroup disk, modify the ASM Pan-head information (Modifying the header), so as to achieve rename purposes.

From this point of view, if the manual kfed modified pan head information, kfdhdb.grpname fields, and then merge into, in fact, can do rename DiskGroup. In theory, the DiskGroup name information is only included in the pan-head information, does not involve disk in the pan-head information in the Create timestamp and disk directory of disk create timestamp consistency problem. So you just need to change the pan head.

Below, I have already used RENAMEDG tool to change into New_fra diskgroup, and then change back to the name of Fra. The modification process is as follows:
(Note: Use kfed at your own risk! )

[Oracle@rac1 ~]$ Kfod Disks=all


--------------------------------------------------------------------------------


Disk Size Path User Group


================================================================================


1:6142 mb/dev/asm-acfs01 Oracle DBA


2:6142 MB/DEV/ASM-ACFS02 Oracle DBA


3:1019 MB/DEV/ASM-DATA01 Oracle DBA


4:1019 MB/DEV/ASM-DATA02 Oracle DBA


5:1019 MB/DEV/ASM-DATA03 Oracle DBA


6:1019 MB/DEV/ASM-DATA04 Oracle DBA


7:1019 mb/dev/asm-data05 Oracle DBA


8:1019 MB/DEV/ASM-FRA01 Oracle DBA


9:1019 MB/DEV/ASM-FRA02 Oracle DBA


10:1019 MB/DEV/ASM-FRA03 Oracle DBA


11:1019 MB/DEV/ASM-FRA04 Oracle DBA


12:611 MB/DEV/ASM-OCRVOT1 Oracle DBA


13:611 Mb/dev/asm-ocrvot2 Oracle DBA


14:611 MB/DEV/ASM-OCRVOT3 Oracle DBA


--------------------------------------------------------------------------------


Oracle_sid Oracle_home


================================================================================


+asm1/u01/app/11.2.0.3/grid


+asm2/u01/app/11.2.0.3/grid


[Oracle@rac1 ~]$








[Oracle@rac1 amdu_2016_02_17_14_25_33]$


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ kfed read/dev/asm-fra01 text=fra_1.txt


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ kfed read/dev/asm-fra02 text=fra_2.txt


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ kfed read/dev/asm-fra03 text=fra_3.txt


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ kfed read/dev/asm-fra04 text=fra_4.txt


[Oracle@rac1 amdu_2016_02_17_14_25_33]$


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ # # Modified before


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ cat Fra_1.txt |grep grpname


Kfdhdb.grpname:NEW_FRA; 0x048:length=7


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ VI fra_1.txt


[Oracle@rac1 amdu_2016_02_17_14_25_33]$


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ # # Modified


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ cat Fra_1.txt |grep grpname


Kfdhdb.grpname:FRA; 0x048:length=3


[Oracle@rac1 amdu_2016_02_17_14_25_33]$


[Oracle@rac1 amdu_2016_02_17_14_25_33]$


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ # # Modify remaining fra_2.txt,fra_3.txt,fra_4.txt three files


[Oracle@rac1 amdu_2016_02_17_14_25_33]$


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ cat *.txt |grep grpname


Kfdhdb.grpname:FRA; 0x048:length=3


Kfdhdb.grpname:FRA; 0x048:length=3


Kfdhdb.grpname:FRA; 0x048:length=3


Kfdhdb.grpname:FRA; 0x048:length=3


[Oracle@rac1 amdu_2016_02_17_14_25_33]$


[Oracle@rac1 amdu_2016_02_17_14_25_33]$


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ # # with kfed merge in


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ kfed merge/dev/asm-fra01 text=fra_1.txt


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ kfed merge/dev/asm-fra02 text=fra_2.txt


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ kfed merge/dev/asm-fra03 text=fra_3.txt


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ kfed merge/dev/asm-fra04 text=fra_4.txt


[Oracle@rac1 amdu_2016_02_17_14_25_33]$


[Oracle@rac1 amdu_2016_02_17_14_25_33]$


[Oracle@rac1 amdu_2016_02_17_14_25_33]$


[Oracle@rac1 amdu_2016_02_17_14_25_33]$


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ # #检查盘头是否已经都修改正确了


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ kfed read/dev/asm-fra01 |grep grpname


Kfdhdb.grpname:FRA; 0x048:length=3


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ kfed read/dev/asm-fra02 |grep grpname


Kfdhdb.grpname:FRA; 0x048:length=3


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ kfed read/dev/asm-fra03 |grep grpname


Kfdhdb.grpname:FRA; 0x048:length=3


[Oracle@rac1 amdu_2016_02_17_14_25_33]$ kfed read/dev/asm-fra04 |grep grpname


Kfdhdb.grpname:FRA; 0x048:length=3


[Oracle@rac1 amdu_2016_02_17_14_25_33]$








[Oracle@rac1 amdu_2016_02_17_14_25_33]$ Sqlplus "/As Sysasm"





Sql*plus:release 11.2.0.4.0 Production on Wed Feb 17 14:45:17 2016





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 real application clusters and Automatic Storage Management options





Sql&gt; Select Group_number,name,state from v$asm_diskgroup where name like '%fra% ';





Group_number NAME State


------------ ------------------------------ -----------


3 FRA Mounted





Sql&gt;


Sql&gt;


Sql&gt; Select Disk_number,name,path,mount_status,header_status,mode_status,state from V$asm_disk where GROUP_NUMBER = 3;





Disk_number NAME PATH mount_s header_statu mode_st State


----------- ------------------------------ ------------------------------ ------- ------------ ------- --------


0 FRA_0000/DEV/ASM-FRA01 CACHED member ONLINE NORMAL


2 fra_0002/dev/asm-fra03 CACHED member ONLINE NORMAL


1 fra_0001/dev/asm-fra02 CACHED member ONLINE NORMAL


3 fra_0003/dev/asm-fra04 CACHED member ONLINE NORMAL





Sql&gt;

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.