Remove_Used_Disk_from_an_ASM_Disk_Group_in_Oracle_19c_RAC

How to Safely Remove a Used Disk from an ASM Disk Group in Oracle 19c RAC

Removing or deleting a used disk from an ASM disk group in Oracle 19c RAC without impacting data requires proper planning and validation. ASM provides built-in rebalancing capabilities, but certain checks must be completed to ensure data integrity and system stability.

This article walks through a step-by-step procedure to safely remove a disk from an ASM disk group.

Key Points to Remember

In Normal or High Redundancy disk groups, ASM automatically redistributes data across remaining disks.

For External Redundancy, ensure sufficient free space is available before removing a disk.

FREE_MB must be greater than the space used by the disk you plan to drop.

REQUIRED_MIRROR_FREE_MB must be less than FREE_MB to maintain proper mirroring.

ASM Rebalance Power controls the speed of data redistribution when disks are added or removed.

Rebalance Power Example

ALTER DISKGROUP DATA REBALANCE POWER 1;

Recommended range: 1–11

Maximum possible value: 0–1024, depending on system resources

Higher values increase resource usage (CPU & I/O)

Example Scenario

We have an ASM disk group named +DATA with multiple disks.

The goal is to safely remove one disk: DS8.

Step 1: Check Existing Disks in the Disk Group

SET LINES 200

COL name FORMAT a20

COL path FORMAT a28

COL total_mb FORMAT 99999

COL free_mb FORMAT 99999

SELECT group_number,

name,

path,

total_mb,

free_mb,

header_status,

mount_status,

state

FROM v$asm_disk

WHERE group_number = (

SELECT group_number

FROM v$asm_diskgroup

WHERE name = ‘DATA’

);

Sample Output

GROUP_NUMBER NAME        PATH        TOTAL_MB FREE_MB HEADER_STATUS MOUNT_STATUS STATE

———— ———– ———– ——– ——- ————- ———— ——

2            DS8         /tst/asm       2048     848 MEMBER          CACHED        NORMAL

2            DATA_0000   /tst/asm      20480   20480 MEMBER          CACHED        NORMAL

 

Step 2: Check Disk Group Redundancy and Space

SELECT name,

type,

state,

total_mb,

free_mb,

required_mirror_free_mb,

usable_file_mb

FROM v$asm_diskgroup

WHERE name = ‘DATA’;

Sample Output

NAME  TYPE   STATE    TOTAL_MB FREE_MB REQUIRED_MIRROR_FREE_MB USABLE_FILE_MB

—– —— ——– ——– ——- ———————– ————–

DATA  EXTERN MOUNTED   20480   19000                       0          16000

 

Ensure the disk group has enough free space before proceeding.

SELECT name, free_mb, required_mirror_free_mb

FROM v$asm_diskgroup

WHERE name = ‘DATA’;

Step 3: Drop the Disk from ASM Disk Group

Run the following command to remove the disk and allow ASM to rebalance the data automatically:

ALTER DISKGROUP DATA DROP DISK DS8;

Alternative Commands (Use with Caution)

ALTER DISKGROUP DATA_DG DROP DISK DS1;

DROP DISKGROUP DATA_DG INCLUDING CONTENTS;

The second command removes the entire disk group and should only be used when decommissioning it completely.

 

Step 4: Monitor the Rebalancing Process

ASM redistributes data across remaining disks during rebalancing.

SELECT group_number,

operation,

state,

est_minutes

FROM v$asm_operation;

Monitor until STATE shows COMPLETED

If no rows are returned, rebalancing has already finished

 

Step 5: Verify Disk Group Status After Rebalancing

SELECT name, total_mb, free_mb

FROM v$asm_diskgroup

WHERE name = ‘DATA’;

Sample Output

NAME  TOTAL_MB FREE_MB

—– ——– ——-

DATA   20480   17272

 

Step 6: Confirm Disk Removal from ASM

SELECT name, path

FROM v$asm_disk

WHERE group_number = (

SELECT group_number

FROM v$asm_diskgroup

WHERE name = ‘DATA’

);

Sample Output

NAME       PATH

———- —————-

DATA_0000  /tst/asmK

If the disk is no longer listed, it has been successfully removed.

Step 7: Decommission the Physical Disk (Optional)

Check disks that are no longer part of any ASM disk group:

SELECT disk_number, name, path

FROM v$asm_disk

WHERE header_status = ‘FORMER’;

Sample Output

DISK_NUMBER NAME  PATH

———– —– —————-

1                 /tst/asm/DS05

0                 /tst/asm/DS08

Disks with HEADER_STATUS = ‘FORMER’ are available for reuse.

Step 8: Clear ASM Metadata (If Reusing the Disk)

To reuse the disk for another ASM disk group or a different purpose:

dd if=/dev/zero of=/dev/sdX bs=1024 count=100

or for AFD disks:

asmcmd afd_label <disk> –init

 

Step 9: Remove Disk from ASM Configuration (ASMLib)

oracleasm deletedisk DS8

Step 10: Final Verification

Verify disk group health and ensure no impact on the database:

SELECT *

FROM v$asm_diskgroup

WHERE name = ‘DATA’;

Confirm:

Disk group state is MOUNTED

No offline disks

No errors in ASM or database alert logs

 

Conclusion

By following these steps, you can safely remove a used disk from an ASM disk group in Oracle 19c RAC without data loss or service disruption. ASM’s rebalancing mechanism ensures data remains available and properly distributed across remaining disks.

Recent Posts