Problem
How can I find my metastore ID?
Cause
The metastore ID may be required for various reasons. For example, for quota increases or to append it to a new workspace via automation tools such as Terraform.
Solution
You can find your metastore ID at the account level or the workspace level.
The metastore ID has the following format XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX.
Account console level
Info
You must be a Databricks account administrator to view information in the account console.
- Click Manage account in the workspace selector to access your account console (AWS | Azure | GCP).
- Click Catalog in the sidebar.
- In the Name column click the metastore you want to view.
- From here you can refer to the ID in different ways:
- Under the bucket path section, the metastore ID is the last part of the path reference.
<s3 | abfss |gs>://<your-bucket-name>/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
- In the browser URL, the metastore ID is after data/ and before /configurations.
https://accounts.cloud.databricks.com/data/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX/configurations?account_id=<your-account-id>
- Under the bucket path section, the metastore ID is the last part of the path reference.
Workspace Level
You can view the metastore ID for a metastore that is already attached to the workspace (AWS | Azure | GCP) by using Catalog Explorer or system tables.
Using Catalog Explorer
- Login to your workspace.
- Click Catalog (AWS | Azure | GCP) in the sidebar.
- Within the Catalog Explorer, select any Catalog different from the
hive_metastore
one. - Click Details.
- Your metastore ID is displayed in the Metastore Id field.
Using system tables
To use this approach, you must have SELECT
permissions against the current metastore (AWS | Azure | GCP) and the system tables (AWS | Azure | GCP).
- Login to your workspace.
- Click SQL Editor (AWS | Azure | GCP) in the sidebar to open the SQL editor or create a notebook (AWS | Azure | GCP) with SQL code.
- Attach a Unity Catalog enabled compute resource (AWS | Azure | GCP).
- Run this query:
SELECT metastore_id
FROM system.information_schema.metastores;
- The query output displays the metastore ID attached to the workspace.