Db::verify API Ref

#include <db_cxx.h>

int Db::verify(const char *file, const char *database, ostream *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 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 either returns a non-zero error value or throws an exception that encapsulates a non-zero error value on failure, and returns 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 DbEnv::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 throw DbException, encapsulating one of the following non-zero errors, or 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.