DB->upgrade API Ref

#include <db.h>

int DB->upgrade(DB *db, 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 returns a non-zero error value on failure and 0 on success.

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

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