System Procedures and Functions
System and catalog stored procedures
Validates all tables in a database.
sa_validate ( [ tbl_name ] [, owner_name ] [, check_type ] )
DBA authority required
None
This procedure is equivalent to calling the VALIDATE TABLE statement for each table in the database.
For information, see VALIDATE TABLE statement.
tbl_name Validate only the specified table. When NULL (the default), validate all tables.
owner_name Validate only the tables owned by the specified user. When NULL (the default), validate tables for all users.
check_type When NULL (the default), each table is checked using a VALIDATE TABLE statement with no additional checks. The check_type value can be one of the following:
data Validate tables using WITH DATA CHECK.
index Validate tables using WITH INDEX CHECK.
full Validate tables using WITH FULL CHECK.
express Validate tables using WITH EXPRESS CHECK.
checksum Validate database pages using checksums.
For more information about checksum validation, see Ensuring your database is valid.
All of the values for the tbl_name, owner_name, and check_type arguments are strings and they must be enclosed in quotes.
The procedure returns a single column, named Messages. If all tables are valid, the column contains No errors detected.
| 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 following statement validates all of the tables owned by the DBA with an index check:
CALL sa_validate (owner_name = 'DBA', check_type = 'index')
SQL Anywhere Studio 9.0.1
Copyright © 1989–2004 Sybase, Inc. Portions copyright © 2001–2004 iAnywhere Solutions, Inc. All rights reserved.