berkdb open |
![]()
|
berkdb open
[-auto_commit]
[-btree | -hash | -recno | -queue | -unknown]
[-cachesize {gbytes bytes ncache}]
[-create]
[-delim delim]
[-dup]
[-dupsort]
[-env env]
[-errfile filename]
[-excl]
[-extent size]
[-ffactor density]
[-len len]
[-mode mode]
[-nelem size]
[-pad pad]
[-pagesize pagesize]
[-rdonly]
[-recnum]
[-renumber]
[-snapshot]
[-source file]
[-truncate]
[-txn txnid]
[--]
[file [database]]
The berkdb open command opens and optionally creates a database. The returned database handle is bound to a Tcl command of the form dbN, where N is an integer starting at 0 (for example, db0 and db1). It is through this Tcl command that the script accesses the database methods.
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.
Because databases opened within Berkeley DB environments use the cache specified to the environment, it is an error to attempt to set a cache in a database created within an environment.
This byte is used for variable length records if the -source argument file is specified. If the -source argument file is specified and no delimiting byte was specified, <newline> characters (that is, ASCII 0x0a) are interpreted as end-of-record markers.
error to specify both -dup and -recnum.