Show TOC

Validating a Database (Command Line)Locate this document in the navigation structure

You can validate a database using the command line.

Prerequisites

You have the VALIDATE ANY OBJECT system privilege. It is best to validate when there is no other activity on the database.
Caution Validating a table or an entire database should be performed while no connections are making changes to the database; otherwise, errors may be reported indicating some form of database corruption even though no corruption actually exists.

Context

If you are checking the validity of a backup copy, run the database in read-only mode so that it is not modified in any way. You can only do this if there were no transactions in progress during the backup.

Procedure

Run the dbvalid utility:
dbvalid -c "connection string"

Results

The database is validated.