DB->verify API Ref

#include <db.h>

int DB->verify(DB *db, const char *file, const char *database, FILE *outfile, u_int32_t flags);


Description: DB->verify

The DB->verify method verifies the integrity of all databases in the file specified by the file parameter, and optionally outputs the databases' key/data pairs to the file stream specified by the outfile parameter.

The DB->verify method does not perform any locking, even in Berkeley DB environments that are configured with a locking subsystem. As such, it should only be used on files that are not being modified by another thread of control.

The DB->verify method may not be called after the DB->open method is called.

The DB handle may not be accessed again after DB->verify is called, regardless of its return.

The DB->verify method is the underlying method used by the db_verify utility. See the db_verify utility source code for an example of using DB->verify in a IEEE/ANSI Std 1003.1 (POSIX) environment.

The DB->verify method will return DB_VERIFY_BAD if a database is corrupted. When the DB_SALVAGE flag is specified, the DB_VERIFY_BAD return means that all key/data pairs in the file may not have been successfully output. Unless otherwise specified, the DB->verify method returns a non-zero error value on failure and 0 on success.

Parameters
database file flags outfile

Environment Variables

If the database was opened within a database environment, the environment variable DB_HOME may be used as the path of the database environment home.

DB->verify is affected by any database directory specified using the DB_ENV->set_data_dir method, or by setting the "set_data_dir" string in the environment's DB_CONFIG file.


Errors
ENOENT

The DB->verify method may fail and return one of the following non-zero errors:


EINVAL


Class DB
See Also Databases and Related Methods

APIRef

Copyright (c) 1996,2008 Oracle. All rights reserved.