DROP DISKGROUP dgroup1 EXCLUDING CONTENTS; - Error because disk group is not empty - Oracle Control Files

Q.  In your Automatic Storage Management (ASM) instance, one of the nonempty disk groups, DGROUP1, is no longer required and you want this disk group to be removed. You execute the following command to achieve this objective.

DROP DISKGROUP dgroup1 EXCLUDING CONTENTS;

What would be the result of this command?

- Published on 12 Aug 15

a. This command would result in an error because the disk group is not empty
b. The command would drop the disk group, ignoring the EXCLUDING CONTENTS option
c. The command would result in the disk group being marked as INVALID because it cannot be dropped
d. The command would result in the contents being moved to the parent disk group and dropping of the disk group

ANSWER: This command would result in an error because the disk group is not empty
 

    Discussion

  • Nirja Shah   -Posted on 30 Sep 15
    INCLUDING CONTENTS
    - Specify INCLUDING CONTENTS to confirm that Automatic Storage Management should drop all the files in the disk group.
    - You must specify this clause if the disk group contains any files.

    EXCLUDING CONTENTS
    - Specify EXCLUDING CONTENTS to ensure that Automatic Storage Management drops the disk group only when the disk group is empty.
    - This is the default.
    - If the disk group is not empty, an error will be returned.

    - The above example is EXCLUDING CONTENTS which means it will give an error.

    - The correct statement which will run without any errors is:

    DROP DISKGROUP dgroup_01 INCLUDING CONTENTS;

Post your comment / Share knowledge


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)