Find your metastore ID

Step-by-step instructions to find the metastore ID.

Written by david.vega

Last published at: October 25th, 2024

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.

 
  1. Click Manage account in the workspace selector to access your account console (AWSAzure | GCP).
  2. Click Catalog in the sidebar.
  3. In the Name column click the metastore you want to view.
  4. From here you can refer to the ID in different ways:
    1. 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 
       
    2. 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>

Workspace Level

You can view the metastore ID for a metastore that is already attached to the workspace (AWSAzure | GCP) by using Catalog Explorer or system tables.

Using Catalog Explorer 

  1. Login to your workspace.
  2. Click Catalog (AWSAzureGCP) in the sidebar.
  3. Within the Catalog Explorer, select any Catalog different from the hive_metastore one.
  4. Click Details.
  5.  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).

  1. Login to your workspace.
  2. Click SQL Editor (AWSAzure | GCP) in the sidebar to open the SQL editor or create a notebook (AWSAzure | GCP) with SQL code.
  3. Attach a Unity Catalog enabled compute resource (AWSAzure | GCP).
  4. Run this query:
SELECT metastore_id
FROM system.information_schema.metastores;   
  1. The query output displays the metastore ID attached to the workspace.