Thursday, March 25, 2010

Dropping a disk from an ASM disk group in Oracle.............. a typical mistake

Dropping a disk from diskgroup is simple but you need to use disk name rather than disk path while dropping.

Checking the diskgroups present

[oracle@11grac1 ~]$ sqlplus / as sysasm


SQL*Plus: Release 11.2.0.1.0 Production on Thu Mar 25 10:44:12 2010

Copyright (c) 1982, 2009, Oracle. All rights reserved.

Connected to:

Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production

With the Real Application Clusters and Automatic Storage Management options


SQL> select name,type,group_number from v$asm_diskgroup;

NAME         TYPE                 GROUP_NUMBER
----------  ------------------ ------------------
DATA          EXTERN                 1
DG1             EXTERN                 2


Checking the disks in the diskgroup

SQL> col path for a30;


SQL> select name,path,group_number from v$asm_disk order by 3;


NAME                 PATH                                 GROUP_NUMBER
----------         ------------------                  ------------------------- ------------

                            /dev/sdh1                                         0

DATA_0002       /dev/sdd1                                         1

DATA_0000      /dev/sdb1                                          1

DATA_0001     /dev/sdc1                                           1

DG1_0002       /dev/sdg1                                            2

DG1_0001       /dev/sdf1                                            2

DG1_0000      /dev/sde1                                            2



Now dropping the disk /dev/sdd1 from diskgroup DATA

SQL> alter diskgroup data drop disk '/dev/sdd1';


alter diskgroup data drop disk '/dev/sdd1'

*
ERROR at line 1:
ORA-15032: not all alterations performed
ORA-15054: disk "/DEV/SDD1" does not exist in diskgroup "DATA"


Correct Syntax is

SQL> alter diskgroup data drop disk DATA_0002;


Diskgroup altered.

Hence while dropping you must use the disk name not the disk path.

1 comment: