Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » Database maintenance


Database validation

Database file corruption may not be reported until the database server tries to access the affected part of the database. You should periodically check that your database is valid by using tools such as the Validate Database Wizard in Sybase Central, the Validation utility (dbvalid), the sa_validate system procedure, or the VALIDATE statement.

Depending on the options you specify, validation can include checksums, correctness of index data, and whether all table pages belong to objects in the database. Express database validation (the dbvalid -fx option) does not validate data, continued row structure, or foreign key relationships. You can also specify the WITH EXPRESS CHECK clause in the VALIDATE statement to disable referential integrity checking.

Validation does not acquire exclusive access to the table being validated and may report corruption if the table is modified during validation. For this reason, it is best to validate when there is no other activity on the database. If a base table in the database file is corrupt, you should treat the situation as a media failure and recover from your previous backup. If an index is corrupt, you may want to unload the database without indexes, and then reload it. You can also use the REBUILD clause of the ALTER INDEX statement to correct index corruption.


Using the BACKUP statement with the WAIT BEFORE START clause ensures that no transactions are in progress when you start a backup. If there were no transactions in progress during the backup, or if you specified BACKUP DATABASE WITH CHECKPOINT LOG RECOVER or WITH CHECKPOINT LOG NO COPY, you can check the validity of the backup database using read-only mode or by validating a copy of the backup database.

 See also

Validating a database (Sybase Central)
Validating a database (SQL)
Validating a database (command line)
Corruption detection using checksums