How to replace disks in ASM

Example of script used for replacement ASM disks in database production:

1. Creating the disk with root user – run in one instance:
cd /etc/init.d
. /oracleasm createdisk ORADT1  /dev/mapper/ORADT1
./oracleasm scandisks
./oracleasm listdisks

2. After create disks, run scandisks in all instances and verify the new disk:
cd /etc/init.d
./oracleasm scandisks
./oracleasm listdisks

3. Add the disk in the Group. You need login on ASM database, on 11g version use grid user and login “as sysasm”:

Alter diskgroup ORADATA ADD DISK '/dev/oracleasm/disks/ORADT1' SIZE 204797 M REBALANCE POWER 5;

The rebalance power 5 is usually for production environment.

4. Wait the end of rebalance. See the query:

 5. After the end of rebalance, drop the old disks:
Alter diskgroup ORADATA DROP DISK ORADISK_0001  rebalance power 5;

6. Wait until the rebalance finished watching the select below. You can clean disk only if goup_number is zero:
select name,group_number,path from v$asm_disk where group_number=0;

7. Clean Header ASM disks (required because of BUG that even after the drop claims that the disk is busy):
dd if=/dev/zero of=/dev/mapper/ORADISK_01 bs=1024 count=100

8. Delete definitely from ASM:
./oracleasm deletedisk /dev/mapper/ORADISK_01

Good Luck !

Leave a Reply