---
title: METASTORES
description: View information about the current metastore with the INFORMATION\_SCHEMA.METASTORES relation in Databricks SQL and Databricks Runtime.
canonical_url: https://docs.databricks.com/aws/en/sql/language-manual/information-schema/metastores
---

# METASTORES

**Applies to:** ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks SQL ![check marked yes](https://docs.databricks.com/aws/en/images/icons/check.png) Databricks Runtime 10.4 LTS and above

INFORMATION\_SCHEMA.METASTORES describes the current metastore.

Information is displayed only for the current metastore for all users.

This is an extension to the SQL Standard Information Schema.

## Definition

The `METASTORES` relation contains the following columns:

| Name                                     | Data type   | Nullable | Description                                                                                                                                              |
| ---------------------------------------- | ----------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `METASTORE_ID`                           | `STRING`    | No       | ID of the metastore.                                                                                                                                     |
| `METASTORE_NAME`                         | `STRING`    | No       | Name of the metastore.                                                                                                                                   |
| `METASTORE_OWNER`                        | `STRING`    | No       | Owner of the metastore.                                                                                                                                  |
| `STORAGE_ROOT`                           | `STRING`    | No       | Storage root URL of the metastore.                                                                                                                       |
| `STORAGE_ROOT_CREDENTIAL_ID`             | `STRING`    | Yes      | ID of the [storage credential](https://docs.databricks.com/aws/en/sql/language-manual/information-schema/storage_credentials.md) to access storage root. |
| `STORAGE_ROOT_CREDENTIAL_NAME`           | `STRING`    | Yes      | Name of the storage credential to access storage root.                                                                                                   |
| `DELTA_SHARING_SCOPE`                    | `STRING`    | No       | OpenSharing scope for the metastore.                                                                                                                     |
| `DELTA_SHARING_RECIPIENT_TOKEN_LIFETIME` | `LONG`      | Yes      | The lifetime of OpenSharing recipient tokens in seconds.                                                                                                 |
| `DELTA_SHARING_ORGANIZATION_NAME`        | `STRING`    | No       | The organization name of an OpenSharing entity. The name will be used in Databricks-to-Databricks OpenSharing as the official name.                      |
| `PRIVILEGE_MODEL_VERSION`                | `STRING`    | No       | Privilege model version.                                                                                                                                 |
| `CLOUD`                                  | `STRING`    | No       | Cloud vendor of the metastore.                                                                                                                           |
| `REGION`                                 | `STRING`    | No       | Dataplane region that the metastore serves.                                                                                                              |
| `GLOBAL_METASTORE_ID`                    | `STRING`    | No       | Globally unique metastore ID across clouds and regions. Used as OpenSharing sharing identifier.                                                          |
| `CREATED`                                | `TIMESTAMP` | No       | Timestamp when the metastore was created.                                                                                                                |
| `CREATED_BY`                             | `STRING`    | No       | [Principal](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-principal.md) who created the metastore.                                      |
| `LAST_ALTERED`                           | `TIMESTAMP` | No       | Timestamp when the metastore was last altered in any way.                                                                                                |
| `LAST_ALTERED_BY`                        | `STRING`    | No       | Principal who last altered the metastore.                                                                                                                |

## Constraints

The following constraints apply to the `METASTORES` relation:

| Class       | Name                  | Column List                                                  | Description                                                                                                                         |
| ----------- | --------------------- | ------------------------------------------------------------ | ----------------------------------------------------------------------------------------------------------------------------------- |
| Primary key | `METASTORES_PK`       | `METASTORE_ID`, `METASTORE_NAME`                             | Unique identifier for the metastore.                                                                                                |
| Foreign key | `METASTORES_CREDS_FK` | `STORAGE_ROOT_CREDENTIAL_ID`, `STORAGE_ROOT_CREDENTIAL_NAME` | References [STORAGE\_CREDENTIALS](https://docs.databricks.com/aws/en/sql/language-manual/information-schema/storage_credentials.md) |

## Examples

```sql
> SELECT metastore_owner
    FROM information_schema.metastores
```

## Related

* [Information schema](https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-information-schema.md)
* [INFORMATION\_SCHEMA.METASTORE\_PRIVILEGES](https://docs.databricks.com/aws/en/sql/language-manual/information-schema/metastore_privileges.md)
