Adding / Dropping Disks From a ASM Disk Group by Jeff Hunter, Sr. Database Administrator
Contents 1. 2. 3. 4.
Overview Identify Candidate Disks Add Disks to a Disk Group Drop Disks from a Disk Group
Overview This short article provides the steps necessary to add a candidate disk to an already existing disk group on the Linux platform. It also documents the steps necessary to remove disks from a running disk group. For the purpose of this document, I already have an existing disk group named TESTDB_DATA1. I am not using the ASMLib libraries.
Identify Candidate Disks The current disk group configuration, (TESTDB_DATA1 and candidate disks not assigned to any disk group) has the following configuration: SQL> @asm_disks Disk Group Name Path --------------- --------------TESTDB_DATA1 /dev/raw/raw1 /dev/raw/raw2 /dev/raw/raw3 /dev/raw/raw4 [CANDIDATE]
File Name -------------------TESTDB_DATA1_0000 TESTDB_DATA1_0001 TESTDB_DATA1_0002 TESTDB_DATA1_0003
Fail Group --------------CONTROLLER1 CONTROLLER1 CONTROLLER2 CONTROLLER2
/dev/raw/raw5 /dev/raw/raw6 /dev/raw/raw7
In this example, I will be adding two new disks (/dev/raw/raw5 and /dev/raw/raw6) to the current disk group.
Add Disks to a Disk Group
Finally, let's add the two new disks to the disk group. This needs to be done within the ASM instance and connected as a user with SYSDBA privileges: $ ORACLE_SID=+ASM; export ORACLE_SID $ sqlplus "/ as sysdba" SQL> ALTER DISKGROUP testdb_data1 ADD 2 FAILGROUP controller1 DISK '/dev/raw/raw5' 3 FAILGROUP controller2 DISK '/dev/raw/raw6' REBALANCE POWER 11; Diskgroup altered.
After adding the new disks, this is a new view of the disk group configuration: Disk Group Name Path --------------- --------------TESTDB_DATA1 /dev/raw/raw1 /dev/raw/raw2 /dev/raw/raw3 /dev/raw/raw4 /dev/raw/raw5 /dev/raw/raw6 [CANDIDATE]
File Name -------------------TESTDB_DATA1_0000 TESTDB_DATA1_0001 TESTDB_DATA1_0002 TESTDB_DATA1_0003 TESTDB_DATA1_0004 TESTDB_DATA1_0005
Fail Group --------------CONTROLLER1 CONTROLLER1 CONTROLLER2 CONTROLLER2 CONTROLLER1 CONTROLLER2
/dev/raw/raw7
Drop Disks from a Disk Group Now, let's drop the same two new disks from the disk group. This needs to be done within the ASM instance and connected as a user with SYSDBA privileges: $ ORACLE_SID=+ASM; export ORACLE_SID $ sqlplus "/ as sysdba"
SQL> ALTER DISKGROUP testdb_data1 DROP 2 DISK testdb_data1_0004, testdb_data1_0005
REBALANCE POWER 11;
Diskgroup altered.
The current disk group configuration, (TESTDB_DATA1 and candidate disks not assigned to any disk group) now has the following configuration: Disk Group Name Path --------------- --------------TESTDB_DATA1 /dev/raw/raw1 /dev/raw/raw2 /dev/raw/raw3 /dev/raw/raw4 [CANDIDATE]
/dev/raw/raw5 /dev/raw/raw6 /dev/raw/raw7
File Name -------------------TESTDB_DATA1_0000 TESTDB_DATA1_0001 TESTDB_DATA1_0002 TESTDB_DATA1_0003
Fail Group --------------CONTROLLER1 CONTROLLER1 CONTROLLER2 CONTROLLER2