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 theWITH OPTIONS clause. Both the
option names and their values must be quoted.
verify_nulls
verify_nulls
When
true, verifies that null values are set to zero. The default is false.verify_persist
verify_persist
When
true, compares persistent objects against their state in memory. The default
is false.verify_rank0
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
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
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 toVERIFY DATABASE is a single-row, 3-column result set:
Examples
To verify the database:VERIFY DATABASE Example
VERIFY DATABASE with Options Example