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
@data Read options from the specified environment variable or configuration file.
-c "keyword=value; ..." Supply database connection parameters.
-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.
-o filename Log output messages to a file.
-q Quiet mode—do not print messages.
-s Validate database pages using checksums.
-t Each object-name is a table.
object-name The name of a table or an index to validate.
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.

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.

Validation utility options 

@data    

Use this option to read in options from the specified environment variable or configuration file. If both exist with the same name, the environment variable is used.

For more information about configuration files, 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.

For more information, see Hiding the contents of files using the dbfhide command-line utility.

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 it.

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 of the VALIDATE TABLE statement. Depending on the contents of your database, this option may significantly extend the time required to validate it.

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 it.

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. The express check option is on by default.

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.

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.

object-name     The name of a table to validate.

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


Collection Contents Previous Next PDF