Create a Unity Catalog metastore

This article shows how to create a metastore in Unity Catalog and link it to workspaces.

Note

In addition to the approaches described in this article, you can also create a metastore by using the Databricks Terraform provider, specifically the databricks_metastore resource. To enable Unity Catalog to access the metastore, use databricks_metastore_data_access. To link workspaces to a metastore, use databricks_metastore_assignment.

Requirements

Create the metastore

To create a Unity Catalog metastore, you do the following:

  • Create a storage bucket where the metastore‚Äôs metadata and managed tables will be stored.

    This storage bucket must be in the same region as the workspaces you want to use to access the data.

    It can be overridden at the catalog and schema levels.

  • Create an IAM role that Databricks uses to give access to that storage bucket.

  • Provide Databricks with the storage container path and IAM role name.

  1. Configure a storage bucket and IAM role in AWS.

    Use a dedicated S3 bucket for each metastore that you create.

    For instructions, see Configure a storage bucket and IAM role in AWS.

    Make a note of the S3 bucket path, which starts with s3://, and the IAM role ARN.

  2. Log in to the Databricks account console.

  3. Click Data Icon Data.

  4. Click Create Metastore.

    1. Enter a name for the metastore.

    2. Enter the region where the metastore will be deployed.

      This must be the same region as the workspaces you want to use to access the data. Make sure that this matches the region of the cloud storage bucket you created earlier.

    3. Enter the S3 bucket path (you can omit s3://) and IAM role name from Configure a storage bucket and IAM role in AWS.

  5. Click Create.

  6. When prompted, select workspaces to link to the metastore.

    For more information about linking workspaces to metastores, see Enable a workspace for Unity Catalog.

The user who creates a metastore is its original metastore admin. Databricks recommends that you reassign the original metastore admin to a group. See (Recommended) Transfer ownership of your metastore to a group.

Enable Databricks management for personal staging locations

Databricks uses cross-origin resource sharing (CORS) to upload data to personal staging locations in Unity Catalog. See Configure Unity Catalog storage account for CORS.

Delete a metastore

If you are closing your Databricks account or have another reason to delete access to data managed by your Unity Catalog metastore, you can delete the metastore.

Warning

All objects managed by the metastore will become inaccessible using Databricks workspaces. This action cannot be undone.

Managed table data and metadata will be auto-deleted after 30 days. External table data in your cloud storage is not affected by metastore deletion.

To delete a metastore:

  1. As a metastore admin, log in to the account console.

  2. Click Data Icon Data.

  3. Click the metastore name.

  4. On the Configuration tab, click the three-button menu at the far upper right and select Delete.

  5. On the confirmation dialog, enter the name of the metastore and click Delete.