berkdb open

APIRef

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]]

Description

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:

-auto_commit
Enclose the call within a transaction. If the call succeeds, changes made by the operation will be recoverable. If the call fails, the operation will have made no changes.

-btree
Open/create a database of type Btree. The Btree format is a representation of a sorted, balanced tree structure.

-hash
Open/create a database of type Hash. The Hash format is an extensible, dynamic hashing scheme.

-queue
Open/create a database of type Queue. The Queue format supports fast access to fixed-length records accessed by sequentially or logical record number.

-recno
Open/create a database of type Recno. The Recno format supports fixed- or variable-length records, accessed sequentially or by logical record number, and optionally retrieved from a flat text file.

-unknown
The database is of an unknown type, and must already exist.

-cachesize {gbytes bytes ncache}
Set the size of the database's shared memory buffer pool (that is, 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; 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.

-create
Create any underlying files, as necessary. If the files do not already exist and the -create argument is not specified, the call will fail.

-delim delim
Set the delimiting byte used to mark the end of a record in the backing source file for the Recno access method.

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.

-dup
Permit duplicate data items in the tree, that is, insertion when the key of the key/data pair being inserted already exists in the tree will be successful. The ordering of duplicates in the tree is determined by the order of insertion unless the ordering is otherwise specified by use of a cursor or a duplicate comparison function.

error to specify both -dup and -recnum.

-dupsort
Sort duplicates within a set of data items. A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default lexical comparison will be used. Specifying that duplicates are to be sorted ynamic A default le