Sometimes  as DBAs may need to recreate ASM Diskgroup on their environments. I face with one issue on our disaster test. Our ORADATA diskgroup sync with Disaster center but ORAFRA diskgroup do not copy to disaster center.
Normally If you have disk on disaster center(In our case diskgroup is ORAFRA) you can select a different name for the diskgroup or drop diskgroup and recreate the raw devices.Recreate the raw devices is required in order to remove completely the ASM metadata.

In my case, Storage team give me one new raw device at disaster center and I need to recreate ORAFRA at disaster center.

You can follow below steps to recreate ASM Diskgroup for 10g&11g.

Steps are different for 10g&11g.So Here is the steps for 11g:

1. Set ASM env.
2. Connect as sysasm to ASM instance.

# sqlplus “/as sysasm”
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Automatic Storage Management option

SQL> CREATE DISKGROUP ORAFRA DISK ‘/dev/rhdisk21’;
CREATE DISKGROUP ORAFRA DISK ‘/dev/rhdisk21’
*
ERROR at line 1:
ORA-15018: diskgroup cannot be created
ORA-15030 diskgroup namedgrp1 is in use by another diskgroup

3. run asmcmd command

# asmcmd -p
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 1843200       261487            0                                  261487                         0                       N              ORADATA/
Our aim is to recreate ORAFRA

ASMCMD [+] > help dropdg
dropdg

Drops a disk group.

dropdg [-r [-f]] diskgroup

The options for the dropdg command are described below.

-f – Force the operation. Only applicable if the disk group
cannot be mounted.
-r – Recursive, include contents.
diskgroup – Name of disk group to drop.

dropdg drops an existing disk group. The disk group cannot be mounted
on more than one node.

These are examples of the use of dropdg. The first example forces the
drop of the disk group data, including any data in the disk group.
The second example drops the disk group fra, including any data in
the disk group.

ASMCMD [+] > dropdg -r -f data
ASMCMD [+] > dropdg -r fra

ASMCMD [+] > dropdg -f -r ORAFRA
ASMCMD [+] > exit

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 1843200 261487 0 261487 0 N ORADATA/

4. Reconnect as sysasm to ASM instance.

# sqlplus “/as sysasm”

SQL*Plus: Release 11.2.0.3.0 Production on Tue Aug 13 10:12:15 2013

Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 – 64bit Production
With the Automatic Storage Management option

SQL> CREATE DISKGROUP ORAFRA EXTERNAL REDUNDANCY DISK ‘/dev/rhdisk21’;

Diskgroup created.

SQL> exit

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 1843200 261487 0 261487 0 N ORADATA/
MOUNTED EXTERN N 512 4096 1048576 307200 271224 0 271224 0 N ORAFRA/

Here is the steps for 10g:

1. Set ASM settings
2. Connect as sysdba to ASM instance.

# sqlplus “/as sysdba”

SQL> CREATE DISKGROUP ORAFRA EXTERNAL REDUNDANCY DISK ‘/dev/rhdisk21’ force;

Diskgroup created.

Reference:
ORA-15030 When Creating Diskgroup and Diskgroup Name Already Referenced in ASM_DISKGROUPS Parameter (Doc ID 1536701.1)
ORA-15030 DISKGROUP NAME “DATA” IS IN USE BY ANOTER DISKGROUP (Doc ID 1530864.1)

Advertisements