DROP EXTERNAL VOLUME¶

Removes an external volume from the account, but retains a version of the external volume so that it can be recovered using UNDROP EXTERNAL VOLUME. For more information, see Usage Notes (in this topic).

See also:

CREATE EXTERNAL VOLUME , ALTER EXTERNAL VOLUME , SHOW EXTERNAL VOLUMES , DESCRIBE EXTERNAL VOLUME

Syntax¶

DROP EXTERNAL VOLUME [ IF EXISTS ] <name>
Copy

Parameters¶

name

Specifies the identifier for the external volume to drop. If the identifier contains spaces, special characters, or mixed-case characters, the entire string must be enclosed in double quotes (for example, "My object"). Identifiers enclosed in double quotes are also case-sensitive.

Access control requirements¶

A role used to execute this SQL command must have the following privileges at a minimum:

Privilege

Object

Notes

OWNERSHIP

External volume

OWNERSHIP is a special privilege on an object that is automatically granted to the role that created the object, but can also be transferred using the GRANT OWNERSHIP command to a different role by the owning role (or any role with the MANAGE GRANTS privilege).

For instructions on creating a custom role with a specified set of privileges, see Creating custom roles.

For general information about roles and privilege grants for performing SQL actions on securable objects, see Overview of Access Control.

Usage notes¶

  • You can’t drop or replace an external volume if one or more Iceberg tables are associated with the external volume.

    To view the tables that depend on an external volume, you can use the SHOW ICEBERG TABLES command and a query using RESULT_SCAN that filters on the external_volume_name column.

    Note

    The column identifier (external_volume_name) is case-sensitive. Specify the column identifier exactly as it appears in the SHOW ICEBERG TABLES output.

    For example:

    SHOW ICEBERG TABLES;
    
    SELECT * FROM TABLE(
      RESULT_SCAN(
          LAST_QUERY_ID()
        )
      )
      WHERE "external_volume_name" = 'my_external_volume_1';
    
    Copy
  • Dropping an external volume does not permanently remove it from the system. Snowflake retains a version of the dropped external volume in Time Travel. You can restore a dropped external volume by using the UNDROP EXTERNAL VOLUME command.

  • After a dropped external volume has been purged, it cannot be recovered; it must be recreated.

  • After dropping an external volume, creating an external volume with the same name creates a new version of the external volume. You can restore the dropped version of the previous external volume by following these steps:

    1. Rename the current version of the external volume.

    2. Use the UNDROP EXTERNAL VOLUME command to restore the previous version.

Examples¶

The following example drops an external volume named my_external_volume:

DROP EXTERNAL VOLUME my_external_volume;
Copy