- -cachesize {gbytes bytes ncache}
- Set the size of the database's shared memory buffer pool, i.e., the cache,
to gbytes gigabytes plus bytes. The cache should be the
size of the normal working data set of the application, with some small
amount of additional memory for unusual situations. (Note, the working
set is not the same as the number of simultaneously referenced pages, and
should be quite a bit larger!)
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, e.g., 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.
- -config {name0 value0 name1 value1...}
- The -config argument is described in
Berkeley DB File Naming.
- -create
- Cause Berkeley DB subsystems to create any underlying files, as necessary.
- -errfile filename
- 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.
The error message will consist of the environment command name (e.g., 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.
- -home directory
- The -home argument is described in
Berkeley DB File Naming.
- -lock
- Initialize the locking subsystem. This subsystem should be used when
multiple processes or threads are going to be reading and writing a Berkeley DB
database, so that they do not interfere with each other. If all threads
are accessing the database(s) read-only, then locking is unnecessary. When
the -lock flag is specified, it is usually necessary to run the
deadlock detector, as well. See db_deadlock and for more
information.
- -lock_max max
- Set the maximum number of locks to be held or requested in the table.
This value is used to estimate how much space to allocate for various
lock-table data structures.
- -log
- Initialize the logging subsystem. This subsystem is used when recovery
from application or system failure is necessary.
The log is stored in one or more files in the environment directory.
Each file is named using the format log.NNNNNNNNNN, where
NNNNNNNNNN is the sequence number of the file within the log.
For further information, see
Log File Limits.
If the log region is being created and log files are already present, the
log files are reviewed and subsequent log writes are appended
to the end of the log, rather than overwriting current log entries.
- -log_max max
- Set the maximum size of a single file in the log, in bytes. The set value
may not be larger than the maximum unsigned 4-byte value.
- -log_buffer size
- Log information is stored in-memory until the storage space fills up
or transaction commit forces the information to be flushed to stable
storage. In the presence of long-running transactions or transactions
producing large amounts of data, larger buffer sizes can increase
throughput.
By default, or if the size is set to 0, a size of 32K is used.
- -mode mode
- 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 writeable by both
owner and group. On Windows systems, the mode argument is ignored.
- -mpool
- Initialize the shared memory buffer pool subsystem. This subsystem is
used whenever the application is using any Berkeley DB access method.
- -private
- Specify that the environment will only be accessed by a single process
(although that process may be multi-threaded). This flag has two effects
on the Berkeley DB environment. First, all underlying data structures are
allocated from per-process memory instead of from shared memory that is
potentially accessible to more than a single process. Second, mutexes
are only configured to work between threads.
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, e.g., if both a server application and the
Berkeley DB utility db_stat will access the environment, the
-private option should not be specified.
- -recover
- Run normal recovery on this environment before opening it for normal use.
If this flag is set, the -create option must also be set since
the regions will be removed and recreated.
- -recover_fatal
- Run catastrophic recovery on this environment before opening it for
normal use. If this flag is set, the -create option must also be
set since the regions will be removed and recreated.
- -system_mem
- Allocate memory from system shared memory instead of memory backed by the
filesystem. This flag is ignored on Microsoft Windows architectures.
See Shared Memory Regions for more
information.
- -txn [nosync]
- Initialize the transaction subsystem. This subsystem is used when
recovery and atomicity of multiple operations and recovery are important.
The -txn option implies the -log option.
If the optional nosync argument is specified, the log will not be
synchronously flushed on transaction commit or prepare. This means that
transactions exhibit the ACI (atomicity, consistency and isolation)
properties, but not D (durability), i.e., 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.
- -txn_max max
- Set the maximum number of simultaneous transactions that are supported
by the environment. This bounds the size of backing files. When there
are more than the specified number of concurrent transactions, calls to
env txn will fail (until some active transactions complete).
- -use_environ
- The Berkeley DB process' environment may be permitted to specify information to
be used when naming files; see Berkeley DB
File Naming. As permitting users to specify which files are used can
create security problems, environment information will be used in file
naming for all users only if the -use_environ flag is set.
- -use_environ_root
- The Berkeley DB process' environment may be permitted to specify information
to be used when naming files; see Berkeley DB
File Naming. As permitting users to specify which files are used can
create security problems, if the -use_environ_root flag is set,
environment information will be used for file naming only for users with
appropriate permissions (e.g., on IEEE/ANSI Std 1003.1 (POSIX) systems, users with a
user-ID of 0).