Delete unassigned catalogs

matthiasn
Databricks Partner

Hi everybody,

due to some not-so-optimal Infrastructure as code experiments with terraform I ended up a lot (triple digit) of catalogs in a metastore that are not assigned to any workspace and that i want to delete.

Unfortunately, there is no way to even list those catalogs using the API. You only can list catalogs that are assigned to workspace. If I could create a list of the catalogs I could assign those to a workspace and delete those catalogs.

Am i missing something on "list all catalog, regardless if assigned to a workspace or not"?

(i am metastore admin and account admin, so no problem regarding access)

Advika
Community Manager
Community Manager

Hello @matthiasn!

Orphaned catalogs usually appear grayed out in the Catalog Explorer UI, so you can check there.

Also, this article might help: https://kb.databricks.com/unity-catalog/grayed-out-catalogs-appearing-in-a-deleted-unity-catalog-reg...

matthiasn
Databricks Partner

Yeah, I see those catalogs and i know that I could reattach and delete them. As i have around 100 those catalogs it would be nice to iterate through them by getting a list, e.g. using the cli or the rest API. And then force delete them , as described in the kb article. i really want to avoid typing all those names 🙂