berkdb env |
berkdb env [-cachesize {gbytes bytes ncache}] [-create] [-data_dir dirname] [-encryptaes passwd] [-encryptany passwd] [-errfile filename] [-home directory] [-log_dir dirname] [-mode mode] [-private] [-recover] [-recover_fatal] [-shm_key shmid] [-system_mem] [-tmp_dir dirname] [-txn [nosync]] [-txn_max max] [-use_environ] [-use_environ_root]
The berkdb env command opens and optionally creates a database environment. The returned environment handle is bound to a Tcl command of the form envN, where N is an integer starting at 0 (for example, env0 and env1). It is through this Tcl command that the script accesses the environment methods. The command automatically initializes the Shared Memory Buffer Pool subsystem. This subsystem is used whenever the application is using any Berkeley DB access method.
The options are as follows:
The default cache size is 256KB, and may not be specified as less than 20KB. Any cache size less than 500MB is automatically increased by 25% to account for buffer pool overhead; cache sizes larger than 500MB are used as specified.
It is possible to specify caches to Berkeley DB that are large enough so that they cannot be allocated contiguously on some architectures; for example, some releases of Solaris limit the amount of memory that may be allocated contiguously by a process. If ncache is 0 or 1, the cache will be allocated contiguously in memory. If it is greater than 1, the cache will be broken up into ncache equally sized separate pieces of memory.
For information on tuning the Berkeley DB cache size, see Selecting a cache size.
When an error occurs in the Berkeley DB library, a Berkeley DB error or an error return value is returned by the function. In some cases, however, the errno value may be insufficient to completely describe the cause of the error especially during initial application debugging.
The -errfile argument is used to enhance the mechanism for reporting error messages to the application by specifying a file to be used for displaying additional Berkeley DB error messages. In some cases, when an error occurs, Berkeley DB will output an additional error message to the specified file reference.
consist of the environment command name (for example, env0) and a colon (":"), an error string, and a trailing <newline> character.
This error-logging enhancement does not slow performance or significantly increase application size, and may be run during normal operation as well as during application debugging.
On UNIX systems, or in IEEE/ANSI Std 1003.1 (POSIX) environments, all files created by Berkeley DB are created with mode mode (as described in chmod(2)) and modified by the process' umask value at the time of creation (see umask(2)). The group ownership of created files is based on the system and directory defaults, and is not further specified by Berkeley DB. If mode is 0, files are created readable and writable by both owner and group. On Windows systems, the mode argument is ignored.
This flag should not be specified if more than a single process is accessing the environment, as it is likely to cause database corruption and unpredictable behavior. For example, if both a server application and the Berkeley DB utility db_stat will access the environment, the -private option should not be specified.
If the optional nosync argument is specified, the log will not be synchronously flushed on transaction commit. This means that transactions exhibit the ACI (atomicity, consistency, and isolation) properties, but not D (durability); that is, database integrity will be maintained, but it is possible that some number of the most recently committed transactions may be undone during recovery instead of being redone.
The number of transactions that are potentially at risk is governed by how often the log is checkpointed (see db_checkpoint for more information) and how many log updates can fit on a single log page.
The berkdb env command returns an environment handle on success.
In the case of error, a Tcl error is thrown.
Copyright (c) 1996-2003 Sleepycat Software, Inc. - All rights reserved.