UNDROP CATALOG
Applies to: Databricks SQL
Databricks Runtime 19 and above
Unity Catalog only
Recovers a dropped catalog in Unity Catalog. By default, you can recover a dropped catalog for 7 days after the drop. If you configured a custom recovery period on the catalog, that period applies instead, and recovery ends shortly before the period ends. See Configure the recovery period.
When you specify the catalog by name, UNDROP CATALOG recovers the most recently dropped catalog with that name that is still recoverable. To recover a different catalog with the same name, use SHOW CATALOGS DROPPED to find its ID, then run UNDROP CATALOG WITH ID.
The recovered catalog keeps its owner, comment, properties, managed storage location, privilege grants, and tags.
UNDROP CATALOG recovers only the catalog. Schemas and other objects that were dropped with the catalog, including the default schema, stay dropped. To recover schemas, tables, and volumes, run UNDROP SCHEMA, UNDROP TABLE, and UNDROP VOLUME after you recover the catalog. Databricks recreates the catalog's information_schema automatically.
Syntax
UNDROP CATALOG { catalog_name | WITH ID catalog_id }
Parameters
-
The name of the dropped catalog to recover. The name can't be qualified.
-
catalog_idA
STRINGliteral with the UUID of the dropped catalog, as shown in thecatalog_idcolumn of SHOW CATALOGS DROPPED.
Permissions
To recover a catalog, you must meet one of the following requirements:
- Be a metastore admin.
- Have the
CREATE CATALOGprivilege on the metastore, and be the owner of the dropped catalog or have theMANAGEprivilege on it.
If the dropped catalog has a managed storage location, you also need the CREATE MANAGED STORAGE privilege on the external location that covers it.
Limitations
- You can recover only standard Unity Catalog catalogs. You can't recover foreign catalogs, catalogs created from OpenSharing shares, or system catalogs.
- If a catalog with the same name already exists,
UNDROP CATALOGfails withUC_UNDROP_RESOURCE_NAME_ALREADY_EXISTS. Rename the existing catalog in Catalog Explorer, then run the command again. See Manage catalogs. - A dropped catalog that is within its recovery period isn't always recoverable.
UNDROP CATALOGchecks current conditions, such as resource quotas, conflicts with other managed storage locations, and workspace bindings. The catalog must have a read-write binding to the current workspace. If a check fails, resolve the reported error, then run the command again. - If you run
UNDROP CATALOGbefore Databricks finishes processing the drop, the command fails withUC_UNDROP_RESOURCE_NOT_READY. Wait, then run the command again. - If more than 1,000 catalogs share the same name, counting the existing catalog and all dropped catalogs with that name, recovering by name fails. Use
UNDROP CATALOG WITH IDinstead.
Examples
To recover the most recently dropped catalog with a given name, run the following:
> CREATE CATALOG sales;
> DROP CATALOG sales CASCADE;
> UNDROP CATALOG sales;
OK
To recover a specific dropped catalog when several share a name, find its ID, then recover it by ID:
> SHOW CATALOGS DROPPED;
catalog_id catalog_name deleted_at created_at updated_at created_by owner
------------------------------------ ------------ ----------------------------- ----------------------------- ----------------------------- ------------- -------------
6ca7be55-8f58-47a7-85ee-7a59082fd17a sales 2026-10-20 AD at 18:17:56 UTC 2026-10-01 AD at 09:00:00 UTC 2026-10-01 AD at 09:00:00 UTC alf@melmak.et alf@melmak.et
b819f397-c51f-4e60-8acc-05d4d4a7e084 sales 2026-10-21 AD at 10:20:00 UTC 2026-10-20 AD at 19:00:00 UTC 2026-10-20 AD at 19:00:00 UTC alf@melmak.et alf@melmak.et
-- The catalog ID is a string literal, so surround it with single quotation marks.
> UNDROP CATALOG WITH ID '6ca7be55-8f58-47a7-85ee-7a59082fd17a';
OK
To recover a catalog when a catalog with the same name already exists, rename the existing catalog first. You can't rename a catalog with SQL, so rename it in Catalog Explorer. See Manage catalogs. Then recover the dropped catalog:
> UNDROP CATALOG sales;
OK
To recover a catalog and the schemas that were dropped with it, recover the catalog first, then each schema:
> UNDROP CATALOG sales;
OK
> SHOW SCHEMAS DROPPED IN sales;
> UNDROP SCHEMA sales.default;
OK
> UNDROP SCHEMA sales.orders;
OK