Merk
Tilgang til denne siden krever autorisasjon. Du kan prøve å logge på eller endre kataloger.
Tilgang til denne siden krever autorisasjon. Du kan prøve å endre kataloger.
Applies to:
Databricks SQL
Databricks Runtime 13.3 LTS and above
Unity Catalog only
Deletes the specified volume.
Note
When you delete a managed volume, the underlying data files are not deleted immediately. Unity Catalog retains them for 7 days and then permanently deletes (purges) them within 48 hours. This retention period applies to data file cleanup and storage billing only — it does not make the volume recoverable. For details about the data file lifecycle and billing, see Object storage lifecycle in Unity Catalog.
If an external volume is dropped, the metadata about the volume is removed from the catalog, but the underlying files are not deleted.
Permissions
To drop a volume, you must be the owner of the volume or have MANAGE on it. You must also have USE CATALOG on the parent catalog and USE SCHEMA on the parent schema where the volume resides.
Per the object hierarchy, owners of the parent schema or catalog and users with MANAGE on either can also perform this operation.
Warning
A dropped volume cannot be recovered.
Syntax
DROP VOLUME [ IF EXISTS ] volume_name
Parameter
IF EXISTS
If specified, no error is thrown when the volume does not exist.
-
The name of the volume to be dropped. If the volume cannot be found Azure Databricks raises an error.
Examples
– Drop a volume named 'my_volume'
> DROP VOLUME my_volume
OK
– Drop a volume named `my_volume` under catalog `my_catalog` and schema `my_schema
> DROP VOLUME my_catalog.my_schema.my_volume
OK
– The volume must exist
> DROP VOLUME my_volume
Error
– Drop a volume named `my_volume` only if it exists
> DROP VOLUME IF EXISTS my_volume
OK