---
title: UNDROP VOLUME
description: Recover an accidentally dropped managed or external Unity Catalog volume by its ID with UNDROP VOLUME in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-undrop-volume
---

# UNDROP VOLUME

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime 19 and above ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Unity Catalog only

The `UNDROP VOLUME` command recovers a dropped volume in Unity Catalog by its volume ID. Use it to restore a volume that was accidentally dropped. You can recover a dropped volume for 7 days after the drop.

Restoring a volume is a metadata operation, so both managed and external volumes can be undropped. The parent schema and catalog must still exist.

To find the ID of a dropped volume, use [SHOW VOLUMES DROPPED](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-aux-show-volumes-dropped.md).

If a live volume in the same schema already uses the name of the volume you want to recover, rename or drop that volume first with [ALTER VOLUME](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-alter-volume.md) or [DROP VOLUME](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-drop-volume.md), then run `UNDROP VOLUME`.

Volume metadata, such as privileges granted on the volume and tags, is recovered. For a managed volume, the files stored in the volume are also recovered.

## Syntax

```
UNDROP VOLUME WITH ID volume_id
```

## Parameter

* **`volume_id`**

  A `STRING` literal in the form of a UUID that identifies the dropped volume, as displayed by [SHOW VOLUMES DROPPED](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-aux-show-volumes-dropped.md).

There is no form that recovers a volume by name. You must identify the volume by its ID.

## Permissions

`UNDROP VOLUME` requires one of the following:

* You own, or have `MANAGE` on, the volume, and you have `CREATE VOLUME` and `USE SCHEMA` on the schema, and `USE CATALOG` on the catalog.
* You own, or have `MANAGE` on, the schema, and you have `USE CATALOG` on the catalog.
* You own, or have `MANAGE` on, the catalog.
* You own the metastore.

In addition, you must have the privileges required to create the volume you restore. For example, to restore an external volume, you must have `CREATE EXTERNAL VOLUME` on the external location.

After the command runs, ownership defaults to the previous volume owner.

## Limitations

You can undrop a volume only within 7 days after it was dropped. After the recovery period passes, the volume is permanently purged and cannot be recovered.

## Examples

```sql
-- Use SHOW VOLUMES DROPPED to find the ID of the dropped volume.
> SHOW VOLUMES DROPPED IN my_catalog.my_schema;
  catalog     schema     volume_name  volume_id                            owner         comment created_at                    created_by
  ----------- ---------- ------------ ------------------------------------ ------------- ------- ----------------------------- -------------
  my_catalog  my_schema  my_volume    6ca7be55-8f58-47a7-85ee-7a59082fd17a alf@melmak.et         2023-05-03 AD at 18:17:00 UTC alf@melmak.et

-- Undrop the volume by its ID.
-- Enclose the volume ID in single quotation marks.
> UNDROP VOLUME WITH ID '6ca7be55-8f58-47a7-85ee-7a59082fd17a';
  OK
```

## Related articles

* [SHOW VOLUMES DROPPED](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-aux-show-volumes-dropped.md)
* [CREATE VOLUME](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-create-volume.md)
* [DROP VOLUME](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-syntax-ddl-drop-volume.md)
* [Object storage lifecycle in Unity Catalog](https://docs.databricks.com/aws/en/data-governance/unity-catalog/object-storage-lifecycle.md)
