db_load

db_load [-nTV] [-c name=value] [-f file]
    [-h home] [-P password] [-t btree | hash | queue | recno] file
db_load [-r lsn | fileid] [-h home] [-P password] file
Description

The db_load utility reads from the standard input and loads it into the database file. The database file is created if it does not already exist.

The input to db_load must be in the output format specified by the db_dump utility, utilities, or as specified for the -T below.

The options are as follows:


-c -f -h -n -P -r -T -t -V

The db_load utility may be used with a Berkeley DB environment (as described for the -h option, the environment variable DB_HOME, or because the utility was run in a directory containing a Berkeley DB environment). In order to avoid environment corruption when using a Berkeley DB environment, db_load should always be given the chance to detach from the environment and exit gracefully. To cause db_load to release all environment resources and exit cleanly, send it an interrupt signal (SIGINT).

The db_load utility exits 0 on success, 1 if one or more key/data pairs were not loaded into the database because the key already existed, and >1 if an error occurs.

Examples

The db_load utility can be used to load text files into databases. For example, the following command loads the standard UNIX /etc/passwd file into a database, with the login name as the key item and the entire password entry as the data item:

awk -F: '{print $1; print $0}' < /etc/passwd |
    sed 's/\\/\\\\/g' | db_load -T -t hash passwd.db

Note that backslash characters naturally occurring in the text are escaped to avoid interpretation as escape characters by db_load.


Environment Variables
DB_HOME
Supported Keywords The following keywords are supported for the -c command-line option to the db_load utility. See DB->open for further discussion of these keywords and what values should be specified.

The parenthetical listing specifies how the value part of the name=value pair is interpreted. Items listed as (boolean) expect value to be 1 (set) or 0 (unset). Items listed as (number) convert value to a number. Items listed as (string) use the string value without modification.


bt_minkey (number) chksum (boolean) database (string) db_lorder (number) db_pagesize (number) duplicates (boolean) dupsort (boolean) extentsize (number) h_ffactor (number) h_nelem (number) keys (boolean) re_len (number) re_pad (string) recnum (boolean) renumber (boolean) subdatabase (string)

Copyright (c) 1996,2008 Oracle. All rights reserved.