Its not that quite often your SA asks you to release one of the disks that you been using it for a while for your database but if they do then you need to know how to remove the disk and add a new disk from your ASM.
Here are the steps to Add and Drop a Disk from ASM Diskgroup. Note that asm_power_limit parameter once set is permanent as it writes to both spfile as well (check alert log when you do alter session set asm_power_limit = 10 command to see that it converts it into scope=both).
What's asm_power_limit parameter?
In simple words, Think that you are increasing the work force to finish the job (re-balancing the disk(s)) quicker. You can read more in Oracle Docs.
OK, Coming to simple steps to Add a Disk:
- Assign the disk to ORACLEASM
- /etc/init.d/oracleasm createdisk TIER2_DATA03 /dev/mapper/mpath14p1
- ScanDisk in ALL NODES
- /etc/init.d/oracleasm scandisks
- Check the header_status in v$asm_disks to make sure that the disk can be added (check below for each status description).
- Login as sqlplus / as sysasm – note SYSASM here… (for 11g)
- set lines 200
- select group_number, substr(path,1,20) path, substr(name,1,20) disk_name, total_mb, free_mb, state, header_status, mode_status from v$asm_disk;
- Now Add the Disk to diskgroup.
- alter diskgroup TIER2_DATA add disk 'ORCL:TIER2_DATA03'; --At this point the new disk is added to the group and Re-Balancing is occurring in the background (basically spreading the data across all the disks along with the new one in that diskgroup)
- Check the status in v$asm_operations for rebalancing action.
- select * from v$asm_operation;
- You are ready to start using the new disk.
- Drop the old Disk
- alter diskgroup TIER2_DATA drop disk TIER2_DATA01; --At this point, all the data on disk that you are dropping is being distributed to other disks within that diskgroup.
- select *from v$asm_operation; --to check the status on rebalancing while dropping the disk
- Once dropped from ASM, delete from oracleasm library:
- [root@ndhdbd1 disks]# /etc/init.d/oracleasm deletedisk TIER2_DATA01
- Removing ASM disk "TIER2_DATA01": [ OK ]
- ScanDisk in ALL NODES
- /etc/init.d/oracleasm scandisks
UNKNOWN
- Automatic Storage Management disk header has not been readCANDIDATE
- Disk is not part of a disk group and may be added to a disk group with theALTER DISKGROUP
statementINCOMPATIBLE
- Version number in the disk header is not compatible with the Automatic Storage Management software version.PROVISIONED
- Disk is not part of a disk group and may be added to a disk group with theALTER DISKGROUP
statement. ThePROVISIONED
header status is different from theCANDIDATE
header status in thatPROVISIONED
implies that an additional platform-specific action has been taken by an administrator to make the disk available for Automatic Storage Management.MEMBER
- Disk is a member of an existing disk group. No attempt should be made to add the disk to a different disk group. TheALTER DISKGROUP
statement will reject such an addition unless overridden with theFORCE
optionFORMER
- Disk was once part of a disk group but has been dropped cleanly from the group. It may be added to a new disk group with theALTER DISKGROUP
statement.CONFLICT
- Automatic Storage Management disk was not mounted due to a conflictFOREIGN
- Disk contains data created by an Oracle product other than ASM. This includes datafiles, logfiles, and OCR disks.