The DROP
DISKGROUP
statement enables you to delete an Oracle ASM disk group and optionally, all of its files. You can specify the INCLUDING
CONTENTS
clause if you also want to delete all files that are contained in the disk group. The default is EXCLUDING
CONTENTS
, which provides syntactic consistency and prevents you from dropping the disk group if it has any contents
The Oracle ASM instance must be started and the disk group must be mounted with none of the disk group files open, in order for the DROP DISKGROUP
statement to succeed. The statement does not return until the disk group has been dropped.
When you drop a disk group, Oracle ASM dismounts the disk group and removes the disk group name from the ASM_DISKGROUPS
initialization parameter if a server parameter file is being used. If a text initialization parameter file is being used, and the disk group is mentioned in the ASM_DISKGROUPS
initialization parameter, then you must remove the disk group name from the ASM_DISKGROUPS
initialization parameter before the next time that you shut down and restart the Oracle ASM instance.
The following statement deletes data1
:
DROP DISKGROUP data1;
After ensuring that none of the files contained in data1
are open, Oracle ASM rewrites the header of each disk in the disk group to remove Oracle ASM formatting information. The statement does not specify INCLUDING CONTENTS
, so the drop operation fails if the disk group contains any files.
If an Oracle Automatic Storage Management Cluster File System (Oracle ACFS) file system is mounted on a volume contained in the disk group, then the file system must be dismounted. If the file system has been registered, then it must be deregistered. The INCLUDING
CONTENTS
clause must be used to drop this disk group. All data in the file system is destroyed. To view the volumes and mount paths associated with a disk group, you can query the V$ASM_VOLUME
view. For an example of a query on the V$ASM_VOLUME
view, see Example 12-9. For information about deregistering and dismounting Oracle ACFS file systems, see "Deregistering, Dismounting, and Disabling Volumes and Oracle ACFS File Systems".
If you cannot mount a disk group but must drop it, you can use the FORCE
option of the DROP
DISKGROUP
statement. This command enables you to remove the headers on disks that belong to a disk group that cannot be mounted by any Oracle ASM instances as shown in the following example:
SQL> DROP DISKGROUP data1 FORCE;
The disk group on which you perform this operation should not be mounted anywhere in the cluster. When you use the FORCE
option, the Oracle ASM instance does not attempt to verify that a disk group is being used by another Oracle ASM instance in the same storage subsystem.
You can also drop disks from a disk group with ASMCA. Refer to "Managing Disk Groups with ASMCA".