Monday, 24 August 2015

DROPPING OF DISK GROUP IN RAC

DROPPING A DISKGROUP  FROM +ASM  IN ORACLE 11g RAC.

I have two node RAC cluster   Node01 and Node02. Here  I am going to drop TEST diskgroup from both node.
1. Check the  available diskgroup.

SQL> select dg.name dg_name, dg.state dg_state, dg.type, d.disk_number dsk_no,
d.path, d.mount_status, d.FAILGROUP, d.state
from v$asm_diskgroup dg, v$asm_disk d
where dg.group_number=d.group_number
order by dg_name, dsk_no;  2    3    4    5 

DG_NAME         DG_STATE   TYPE       DSK_NO PATH            MOUNT_S FAILGROUP  STATE
--------------- ---------- ------ ---------- --------------- ------- ---------- --------
DATA            MOUNTED    EXTERN          0 ORCL:ASM04      CACHED  ASM04      NORMAL
DATA            MOUNTED    EXTERN          1 ORCL:ASM06      CACHED  ASM06      NORMAL
FRA             MOUNTED    EXTERN          0 ORCL:ASM05      CACHED  ASM05      NORMAL
OCR_VOT         MOUNTED    NORMAL          0 ORCL:ASM01      CACHED  ASM01      NORMAL
OCR_VOT         MOUNTED    NORMAL          1 ORCL:ASM02      CACHED  ASM02      NORMAL
OCR_VOT         MOUNTED    NORMAL          2 ORCL:ASM03      CACHED  ASM03      NORMAL
TEST            MOUNTED    EXTERN          0 ORCL:ASM07      CACHED  ASM07      NORMAL


 SET LINESIZE  145
 SET PAGESIZE  9999
 SET VERIFY    off
 COLUMN group_name             FORMAT a20           HEAD 'Disk Group|Name'
 COLUMN sector_size            FORMAT 99,999        HEAD 'Sector|Size'
 COLUMN block_size             FORMAT 99,999        HEAD 'Block|Size'
 COLUMN allocation_unit_size   FORMAT 999,999,999   HEAD 'Allocation|Unit Size'
 COLUMN state                  FORMAT a11           HEAD 'State'
 COLUMN type                   FORMAT a6            HEAD 'Type'
 COLUMN total_mb               FORMAT 999,999,999   HEAD 'Total Size (MB)'
 COLUMN used_mb                FORMAT 999,999,999   HEAD 'Used Size (MB)'
 COLUMN pct_used               FORMAT 999.99        HEAD 'Pct. Used'



 break on report on disk_group_name skip 1
 compute sum label "Grand Total: " of total_mb used_mb on report


 SELECT
     name                                     group_name
   , sector_size                              sector_size
   , block_size                               block_size
   , allocation_unit_size                     allocation_unit_size
   , state                                    state
   , type                                     type
   , total_mb                                 total_mb
   , (total_mb - free_mb)                     used_mb
   , ROUND((1- (free_mb / total_mb))*100, 2)  pct_used
 FROM
     v$asm_diskgroup
 ORDER BY
     name
 /

Disk Group            Sector   Block   Allocation
Name                    Size    Size    Unit Size State       Type   Total Size (MB) Used Size (MB) Pct. Used
-------------------- ------- ------- ------------ ----------- ------ --------------- -------------- ---------
DATA                     512   4,096    1,048,576 MOUNTED     EXTERN          11,718          7,416     63.29
FRA                      512   4,096    1,048,576 MOUNTED     EXTERN           5,859            886     15.12
OCR_VOT                  512   4,096    1,048,576 MOUNTED     NORMAL          17,579          1,052      5.98
TEST                     512   4,096    1,048,576 MOUNTED     EXTERN           5,859             50       .85
                                                                     --------------- --------------
Grand Total:                                                                  41,015          9,404


2. Loging with Node01 and try to run TEST diskgroup . You will get the following error.

SQL> drop diskgroup test;
drop diskgroup test
*
ERROR at line 1:
ORA-15039: diskgroup not dropped
ORA-15001: diskgroup "TEST" does not exist or is not mounted

Resolve:-

3. To resolve this . Login to Node02 first and dismount the diskgroup there.

break on report on disk_group_name skip 1
 compute sum label "Grand Total: " of total_mb used_mb on report


 SELECT
     name                                     group_name
   , sector_size                              sector_size
   , block_size                               block_size
   , allocation_unit_size                     allocation_unit_size
   , state                                    state
   , type                                     type
   , total_mb                                 total_mb
   , (total_mb - free_mb)                     used_mb
   , ROUND((1- (free_mb / total_mb))*100, 2)  pct_used
 FROM
     v$asm_diskgroup
 ORDER BY
     name
 /

Disk Group            Sector   Block   Allocation
Name                    Size    Size    Unit Size State       Type   Total Size (MB) Used Size (MB) Pct. Used
-------------------- ------- ------- ------------ ----------- ------ --------------- -------------- ---------
DATA                     512   4,096    1,048,576 MOUNTED     EXTERN          11,718          7,416     63.29
FRA                      512   4,096    1,048,576 MOUNTED     EXTERN           5,859            886     15.12
OCR_VOT                  512   4,096    1,048,576 MOUNTED     NORMAL          17,579          1,052      5.98
TEST                     512   4,096    1,048,576 MOUNTED     EXTERN           5,859             50       .85
                                                                     --------------- --------------

SQL> !hostname
node02.example.com

SQL> alter diskgroup test dismount;

Diskgroup altered.

SQL>


4. Login to node01 and Now you can drop the TEST from node01 and here your TEST diskgroup should be in mount mode.

SQL> !hostname
node01.example.com


SQL> drop diskgroup test;

Diskgroup dropped.

SQL>

No comments:

Post a Comment