Db::upgrade API Ref

#include <db_cxx.h>

int Db::upgrade(const char *file, u_int32_t flags);


Description: Db::upgrade

The Db::upgrade method upgrades all of the databases included in the file file, if necessary. If no upgrade is necessary, Db::upgrade always returns success.

Database upgrades are done in place and are destructive. For example, if pages need to be allocated and no disk space is available, the database may be left corrupted. Backups should be made before databases are upgraded. See Upgrading databases for more information.

Unlike all other database operations, Db::upgrade may only be done on a system with the same byte-order as the database.

The Db::upgrade 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
file flags

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::upgrade 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

The Db::upgrade method may fail and throw DbException, encapsulating one of the following non-zero errors, or return one of the following non-zero errors:


DB_OLD_VERSION

EINVAL


Class Db
See Also Databases and Related Methods

APIRef

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