Friday, July 1, 2011

Deleting DISK from DISKGROUP

Lets see how we can delete an ASM disk in DISKGROUP.
Currently, we have 3 disks in DATA diskgroup.











I want to drop disk1 from DATA diskgroup.

SQL> alter diskgroup data drop disk 'D:\ASMDISKS\DISK1';
alter diskgroup data drop disk 'D:\ASMDISKS\DISK1'
*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15054: disk "D:\ASMDISKS\DISK1" does not exist in diskgroup "DATA"











SOLUTION : ONE has to use the name that has been designated in ASM, not as we have given it as disk1.

SQL> select path,name from v$asm_disk where group_number=1;









Here, Disk1 name is DATA_0000. Alter diskgroup data drop disk DATA_0000 will work;






DISK 1 deleted.
Lets check whether DISK1 deleted or not.
select path,name from v$asm_disk where group_number=1;







The DISK1 is no more in DATA diskgroup.

Adding DISK in DISKGROUP

I have two disks, disk1 and disk2, I want to add new disk3 to diskgroup DATA.

SQL> select disk_number, name, path from v$ASM_DISK;

DISK_NUMBER NAME PATH
----------- ------------------------------ --------------------
0 DATA_0000 D:\ASMDISK\DISK1
1 DATA_0001 D:\ASMDISK\DISK2

When I execute the below command for adding disk3, i get below error.














The error :
ORA-15031: disk specification 'D:\asmdisk\disk3' matches no disk



I realized that I need to create a disk physically, then I should create the disk3 with above command.
asmtool -create d:\asmdisk\disk3 1024







SQL> alter diskgroup data add disk 'D:\asmdisk\disk3';

Diskgroup altered.




SQL> select disk_number, name, path from v$ASM_DISK;











In my Next, post I will delete disk, diskgroup from ASM.