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

SQL Anywhere 10.0.1 » SQL Anywhere Server - Database Administration » Database Administration Utilities

Upgrade utility (dbupgrad) Next Page

Validation utility (dbvalid)


Validates the indexes and keys on some or all of the tables and materialized views in a database.

Syntax

dbvalid [ options ] [ object-name, ... ]

Option Description
@data

Use this option to read in options from the specified environment variable or configuration file. See Using configuration files.

If you want to protect passwords or other information in the configuration file, you can use the File Hiding utility to obfuscate the contents of the configuration file. See File Hiding utility (dbfhide).

-c "keyword=value; ..."

For a description of the connection parameters, see Connection parameters. The user ID must have DBA authority or VALIDATE authority.

For example, the following command validates the database c:\salesdata.db, connecting as user DBA with password sql:

dbvalid -c "UID=DBA;PWD=sql;DBF=c:\salesdata.db"
-d Use this option to validate that all table pages in the database belong to the correct object, and perform a checksum validation. The -d option does not include validation of data or indexes. The -d option cannot be used with the -i, -s, or -t options.
-fx Use this option to validate every row of the table, and make sure that the number of rows in the table matches the number of rows in each index associated with the table. This option does not perform individual index lookups for each row. Using this option can significantly improve performance when validating large databases with a small cache.
-i Validate the specified index.
-o filename Write output messages to the named file.
-q Do not display output messages to the client. You can still log the messages to file using the -o option, however.
-s Checksums are used to determine whether a database page has been modified on disk. If you created a database with checksums enabled, you can validate the database using checksums. Checksum validation reads each page of the database from disk and calculates its checksum. If the calculated checksum is different from the checksum stored on the page, the page has been modified on disk and an error is returned. The page numbers of any invalid pages appear in the Server Messages window. The -s option cannot be used in conjunction with -d, -i, -t, or either of the -f options.
-t

The list of object-name values represents a list of tables and materialized views. This is the default behavior.

object-name

Specify the name of the table or materialized view to validate.

If -i is used, object-name refers to an index to validate instead.

Remarks

With the Validation utility, you can validate the indexes and keys on some or all of the tables and materialized views in a database. You can also use the Validation utility to verify that all table pages in the database belong to the correct object, and that page checksums are correct. By default, dbvalid validates all the tables and materialized views in the database (the same behavior as the -t option).

For each table or materialized view, the Validation utility scans the entire object, and then looks up each record in every index and key defined on the table. You can also use the Validation utility to verify that all table pages in the database belong to the correct object, and that page checksums are correct. To run the Validation utility, you have either DBA or VALIDATE authority. By default, dbvalid validates all the tables and materialized views in the database.

With the Validation utility, you can validate the indexes and keys on some or all of the tables and materialized views in the database.

This utility can be used in combination with regular backups to give you confidence in the integrity of the data in your database. See Backup and Data Recovery.

You can also access the Validation utility in the following ways:

Caution    

Validating a table or an entire database should be performed while no connections are making changes to the database; otherwise, spurious errors may be reported indicating some form of database corruption even though no corruption actually exists.

The Validation utility may return warnings about checksum violations for databases that do not have checksums enabled because the database server automatically calculates checksums for critical pages. See Ensuring your database is valid.

Validation requires exclusive access to each table in turn. For this reason, it is best to validate when there is no other activity on the database.

Exit codes are 0 (success) or non-zero (failure). See Software component exit codes.

For more information about specific checks made during validation, see VALIDATE statement.