CHECK DATABASE query verifies the health of a database.
Its primary use is with the DataLakeCatalog database engine, where it checks that the external catalog backing the database is reachable and that its list of tables can be retrieved. This is a lightweight probe: it confirms connectivity and authentication without reading any table data.
Syntax
The basic syntax of the query is as follows:database_name: Specifies the name of the database that you want to check.
Behavior
For a database with theDataLakeCatalog engine, CHECK DATABASE:
- Connects to the external catalog (for example, AWS Glue, Databricks Unity, Hive Metastore, or an Iceberg REST catalog) and retrieves its list of tables.
- Reports success if the catalog is reachable and authentication is valid.
- Does not require the catalog to contain any tables: an empty but reachable catalog is still considered healthy.
CHECK DATABASE completes successfully without performing any work.
Executing CHECK DATABASE requires the CHECK privilege on the database (see GRANT).
Examples
Check aDataLakeCatalog database named datalake:
Query
401 Unauthorized, or a DNS resolution failure).