A technical troubleshooting blog about Oracle with other Databases & Cloud Technologies.

ASM Disk Addition & Deletion

2 min read

Adding Disks to a Disk Group is done with the “alter diskgroup” command.
Oracle provides the alter diskgroup command to adding or removing physical disks within SQL*Plus:

First we identify the ASM diskgroup where we want to add the disk:

Login as: sys as sysasm

SQL> select group_number,name from v$asm_diskgroup; 
   
      GROUP_NUMBER NAME
------------ ------------------------------
           1 DATA_FILES
           2 DATA_FRA
           3 DATA

Next, we identify the disks to see which disk should be added to the diskgroup:

set lin 200 pages 200
col path for a20
select mount_status,header_status,mode_status,state,total_mb,free_mb,name,path,label from v$asm_disk; 
  
     MOUNT_S HEADER_STATU MODE_ST STATE      TOTAL_MB    FREE_MB NAME                           PATH                 LABEL
------- ------------ ------- -------- ---------- ---------- ------------------------------ -------------------- -------------------------------
CACHED  MEMBER       ONLINE  NORMAL         1024        715 DATA_0002                      /dev/mapper/sdd
CACHED  MEMBER       ONLINE  NORMAL        51200       8046 DATA_FILES_0000                /dev/mapper/sde
CACHED  MEMBER       ONLINE  NORMAL         1024        714 DATA_0000                      /dev/mapper/sdb
CACHED  MEMBER       ONLINE  NORMAL         1024        714 DATA_0001                      /dev/mapper/sdc
CACHED  MEMBER       ONLINE  NORMAL        51200      50510 DATA_FRA_0000                  /dev/mapper/sdg

IF HDD IS NOT VISIBLE THEN WE CAN SET THE PARAMETER

SQL>  Alter system set asm_diskstring='/dev/sd*' ;

Now, we can add the disk to the ASM diskgroup:

SQL>  Alter diskgroup DATA add disk '/dev/sdg'; 
SQL>  Alter diskgroup DATA add disk '/dev/sdh'; 

CHECK THE TIME TAKEN TO REBALANCING

SQL> select operation,state,EST_MINUTES from v$asm_operation; 
SQL> select * from v$asm_operation;

We can delete the disk from the ASM diskgroup:

SQL> Alter diskgroup DATA drop disk DATA_0000 
SQL> Alter diskgroup DATA drop disk DATA_FILES_0001

INCREASE POWER LIMIT OF ASM REBALANCING

SQL> show parameter limit

NAME                TYPE        VALUE
------------------- ----------- ------
asm_power_limit     integer     1
SQL> Alter diskgroup DATA rebalance power 2;
Refer for more ASM related commands: 
https://asrblogger.com/asm-scripts/