Skip to main content
Verifies that the database is in a consistent state across the cluster. The verification compares the metadata on the head node with the metadata on each worker, and checks that each table’s records are counted and distributed consistently across the ranks. Options add checks of null values and of persisted objects, and can limit the table checks to particular tables. Only users with the system_admin permission can issue this command, and it cannot be run while the database is in read-only mode. To check individual tables for corrupted data, see CHECK TABLE; to repair them, see REPAIR TABLE.
VERIFY DATABASE Syntax
Through SQL, the verification runs as part of the SQL statement, alongside any other database activity, rather than on its own. As a result:
  • Orphaned table data (table data on the workers with no corresponding metadata) is not checked. To check for orphaned table data, use the /admin/verifydb endpoint, which pauses other database activity while it runs.
  • Differences in metadata between the head node and the workers may be reported while other DDL is in progress. Run the verification again to confirm any such finding before acting on it.

Options

The following options can be specified in the WITH OPTIONS clause. Both the option names and their values must be quoted.

verify_nulls

When true, verifies that null values are set to zero. The default is false.

verify_persist

When true, compares persistent objects against their state in memory. The default is false.

verify_rank0

When true, compares the table metadata on the head node (rank 0) against the table metadata on each worker. The default is false.

table_includes

Comma-separated list of tables to include when verifying table consistency on the workers; all other tables are skipped. Cannot be used with table_excludes.

table_excludes

Comma-separated list of tables to exclude when verifying table consistency on the workers. Cannot be used with table_includes.

Response

The response to VERIFY DATABASE is a single-row, 3-column result set:

Examples

To verify the database:
VERIFY DATABASE Example
To verify the database, also checking null values and comparing the table metadata on the head node against that on the workers:
VERIFY DATABASE with Options Example