Collection Contents Previous Next PDF

ASA Database Administration Guide

Database Administration Utilities

The Validation utility

Validating a database using the dbvalid command-line utility


Syntax 

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

Option Description
object-name The name of a table or (if –i is used) an index to validate
–c "keyword=value; ..." Supply database connection parameters
–o filename Log output messages to a file
–f Validate tables with full check
–fd Validate tables with data check
–fi Validate tables with index check
–fn Validate tables with the historical validation algorithm (used in versions 9.0.0 and earlier of the software)
–fx Validate tables with express check
–i Each object-name is an index
–q Quiet mode—do not print messages
-s Validate database pages using checksums
–t Each object-name is a table
Description 

With the Validation utility, you can validate the indexes and keys on some or all of the tables in the database. This utility scans the entire table, and confirms that each row in the table exists in the appropriate indexes. It is equivalent to running the VALIDATE TABLE statement on each table.

By default, the Validation utility uses the express check option. However, the express check option is not used if you specify –f, –fd, –fi, –fn, or –i, or if the database was created with a version of the software earlier than version 7.0.

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.

Exit codes are:

Program Exit Code Description
0 Database validated successfully
1 General failure in utility
2 Error validating database
7 Unable to find database to connect to (database name is wrong)
8 Unable to connect to database (user ID/password is wrong)
11 Unable to find server to connect to (server name is wrong)
12 Incorrect encryption key for starting database

For information on specific checks made during validation, see VALIDATE TABLE statement.

For more information about the Validation utility options, see Validation utility options.

This utility accepts @filename parameters.

For more information, see @filename server option.

Validation utility options 

Connection parameters (–c)    For a description of the connection parameters, see Connection parameters. The user ID must have DBA authority or REMOTE DBA authority.

For example, the following validates the sample database, connecting as user DBA with password SQL:

dbvalid –c "uid=DBA;pwd=SQL;dbf=c:\asa\asademo.db"

Full check for each table (–f)    In addition to the default validation checks, carry out both data checks (–fd) and index checks (–fi). This corresponds to the WITH FULL CHECK option on the VALIDATE TABLE statement. Depending on the contents of your database, this option may significantly extend the time required to validate.

Data check for each table (–fd)    In addition to the default validation checks, check that all of each LONG BINARY, LONG VARCHAR, TEXT, or IMAGE data type can be read. This corresponds to the WITH DATA CHECK option on the VALIDATE TABLE statement. Depending on the contents of your database, this option may significantly extend the time required to validate.

Index check for each table (–fi)    In addition to the default validation checks, validate each index on the table. This corresponds to the WITH INDEX CHECK option on the VALIDATE TABLE statement. Depending on the contents of your database, this option may significantly extend the time required to validate.

Use historical validation algorithm to check each table (–fn)    Use the validation algorithm that was used in versions 9.0.0 and earlier of the software instead of the express check algorithm.

Express check for each table (–fx)    In addition to the default and data checks (–fd), check that the number of rows in the table matches the number of entries in the index. This corresponds to the WITH EXPRESS CHECK option on the VALIDATE TABLE STATEMENT. 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. This option is only available for databases created with version 7.0 or later of Adaptive Server Anywhere.

Validate specified indexes (–i)    Instead of validating tables, validate indexes. In this case, for dbvalid, each of the object-name values supplied represents an index rather than a table, and has a name of the following form:

[ [ owner.]table-name.]index-name

Log output messages to file (–o)    Write output messages to the named file.

Operate quietly (–q)    Do not display output messages. This option is available only when you run this utility from a command prompt.

Validate database using page checksums (–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 –i, –t, or any of the –f options.

Validate tables (–t)    The list of object-name values represents a list of tables. This is also the default behavior.


Collection Contents Previous Next PDF