Create/Drop Diskgroup

Drop an used DG using  dismount force and drop DG force option

DG Status :

SQL> select dg.inst_id, dg.name dg_name,  dg.state dg_state,  dg.type,d.name, d.DISK_NUMBER dsk_no, d.MOUNT_STATUS, d.HEADER_STATUS, d.MODE_STATUS,
        d.STATE, d. PATH, d.FAILGROUP  FROM GV$ASM_DISK d,  Gv$asm_diskgroup dg
     where dg.inst_id=d.inst_id and  dg.group_number(+)=d.group_number and    dg.name=:dg_name order by inst_id, dsk_no;

   INST_ID DG_NAME    DG_STATE     TYPE         NAME         DSK_NO MOUNT_S HEADER_STATU MODE_ST STATE      PATH                 FAILGROUP
---------- ---------- ---------- --------------- ---------- ------- ------- ------------ ------- -------- ------------------------------ ---------------
     1 ACFS       MOUNTED     NORMAL      ACFS_DISK1      0 CACHED  MEMBER     ONLINE  NORMAL   /dev/asm_test_1G_disk1     ACFS_000
     1 ACFS       MOUNTED     NORMAL      ACFS_DISK2      1 CACHED  MEMBER     ONLINE  NORMAL   /dev/asm_test_1G_disk2     ACFS_001
     2 ACFS       MOUNTED     NORMAL      ACFS_DISK1      0 CACHED  MEMBER     ONLINE  NORMAL   /dev/asm_test_1G_disk1     ACFS_000
     2 ACFS       MOUNTED     NORMAL      ACFS_DISK2      1 CACHED  MEMBER     ONLINE  NORMAL   /dev/asm_test_1G_disk2     ACFS_001
     3 ACFS       MOUNTED     NORMAL      ACFS_DISK1      0 CACHED  MEMBER     ONLINE  NORMAL   /dev/asm_test_1G_disk1     ACFS_000
     3 ACFS       MOUNTED     NORMAL      ACFS_DISK2      1 CACHED  MEMBER     ONLINE  NORMAL   /dev/asm_test_1G_disk2     ACFS_001
--> Diskgroup ACFS is mounted by all RAC nodes 

SQL> select    g.name disk_grp, o.group_number, operation , est_minutes from gv$asm_operation o,    v$asm_diskgroup g
         where g.group_number = o.group_number;
--> No rebalancing action in progress 

SQL> select f.inst_id, f.group_number, file_number, compound_index, incarnation, f.block_size, bytes/1024/1024/1024 GB, f.type, striped,
         creation_date, modification_date from gv$asm_file f  , Gv$asm_diskgroup dg where f.group_number = dg.group_number and
          dg.inst_id=f.inst_id and dg.name=:dg_name;

   INST_ID GROUP_NUMBER FILE_NUMBER COMPOUND_INDEX INCARNATION BLOCK_SIZE      GB TYPE         STRIPE CREATION_ MODIFICAT
---------- ------------ ----------- -------------- ----------- ---------- ---------- --------------- ------ --------- ---------
     1          3     256      50331904   853603855         8192 .097663879 DATAFILE         COARSE 22-JUL-14 22-JUL-14
     2          3     256      50331904   853603855         8192 .097663879 DATAFILE         COARSE 22-JUL-14 22-JUL-14
     3          3     256      50331904   853603855         8192 .097663879 DATAFILE         COARSE 22-JUL-14 22-JUL-14
 --> only 1 Datafile is there - this file is used by all cluster nodes

SQL> select c.INST_ID, dg.name DGName, c.GROUP_NUMBER, INSTANCE_NAME, DB_NAME,    STATUS,       SOFTWARE_VERSION ,COMPATIBLE_VERSION
        from Gv$asm_client c , Gv$asm_diskgroup dg  where dg.inst_id=c.inst_id and  dg.group_number=c.group_number and dg.name=:dg_name;

   INST_ID DGNAME              GROUP_NUMBER INSTANCE_N DB_NAME  STATUS    SOFTWARE_VERSION     COMPATIBLE_VERSION
---------- ------------------------------ ------------ ---------- -------- ------------ -------------------- --------------------
     1 ACFS                      3 grac41      grac4    CONNECTED    11.2.0.4.0         11.2.0.4.0
     2 ACFS                      3 grac42      grac4    CONNECTED    11.2.0.4.0         11.2.0.4.0
     3 ACFS                      3 grac43      grac4    CONNECTED    11.2.0.4.0         11.2.0.4.0
-
OPEN files monitored by running : asmcmd lsof -G ACFS on all cluster nodes 
OPEN-Files  for DG: ACFS
grac41.example.com
DB_Name  Instance_Name  Path                                        
grac4    grac41         +acfs/grac4/datafile/acfs_ts.256.853603855  

grac42.example.com
DB_Name  Instance_Name  Path                                        
grac4    grac42         +acfs/grac4/datafile/acfs_ts.256.853603855  

grac43.example.com
DB_Name  Instance_Name  Path                                        
grac4    grac43         +acfs/grac4/datafile/acfs_ts.256.853603855  

Drop diskgroup ACFS
SQL> drop diskgroup ACFS ;
drop diskgroup ACFS
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15053: diskgroup "ACFS" contains existing files

SQL>  drop diskgroup ACFS force;
 drop diskgroup ACFS force
                         *
ERROR at line 1:
ORA-02000: missing INCLUDING keyword

SQL> drop diskgroup ACFS force including contents;
drop diskgroup ACFS force including contents
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15230: diskgroup 'ACFS' does not require the FORCE option

Stop DG with force option
[grid@grac41 ASM]$  srvctl stop diskgroup -g ACFS -n grac43 -f
[grid@grac41 ASM]$  srvctl status diskgroup -g ACFS
Disk Group ACFS is not running

Drop diskgroup with force option 
SQL>  drop diskgroup ACFS  including contents;
 drop diskgroup ACFS  including contents
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15001: diskgroup "ACFS" does not exist or is not mounted

SQL> drop diskgroup ACFS force including contents;
Diskgroup dropped. 

One thought on “Create/Drop Diskgroup”

  1. Hi,

    my question is 1 particular disk is lost,what will happens to that diskgroup? does diskgroup goes to mount state? how to replace the d particular disk?

Leave a Reply

Your email address will not be published. Required fields are marked *