File: db5.3_load.1

package info (click to toggle)
db5.3 5.3.28%2Bdfsg2-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 158,500 kB
  • sloc: ansic: 448,411; java: 111,824; tcl: 80,544; sh: 44,264; cs: 33,697; cpp: 21,604; perl: 14,557; xml: 10,799; makefile: 4,077; javascript: 1,998; yacc: 1,003; awk: 965; sql: 801; erlang: 342; python: 216; php: 24; asm: 14
file content (186 lines) | stat: -rw-r--r-- 8,353 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
.\" Manual Page for Berkeley DB utils, created from upstream
.\" documentation by Thijs Kinkhorst <thijs@kinkhorst.com>.
.TH DB5.3_LOAD 1 "22 November 2009"
.SH NAME
db5.3_load \- Load data from standard input
.SH SYNOPSIS
.B db5.3_load
[-nTV] [-c name=value] [-f file] [-h home] [-P password] [-t btree | hash | queue | recno] file

.B db5.3_load
[-r lsn | fileid] [-h home] [-P password] file
.SH DESCRIPTION
The db5.3_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.
.PP
The input to db5.3_load must be in the output format specified by the db5.0_dump
utility, utilities, or as specified for the -T below.
.SH OPTIONS
.IP \fB\-c\fR
Specify configuration options ignoring any value they may have based on
the input.  The command-line format is \fBname=value\fR.  See the
Supported Keywords section below for a list of keywords supported by
the \fB-c\fR option.
.IP \fB\-f\fR
Read from the specified \fBinput\fR file instead of from the standard
input.
.IP \fB\-h\fR
Specify a home directory for the database environment.
.sp
If a home directory is specified, the database environment is opened
using the DB_INIT_LOCK, DB_INIT_LOG, DB_INIT_MPOOL, DB_INIT_TXN, and
DB_USE_ENVIRON flags to DB_ENV->open.  (This means that db5.3_load can be
used to load data into databases while they are in use by other
processes.) If the DB_ENV->open call fails, or if no home
directory is specified, the database is still updated, but the
environment is ignored; for example, no locking is done.
.IP \fB\-n\fR
Do not overwrite existing keys in the database when loading into an
already existing database.  If a key/data pair cannot be loaded into the
database for this reason, a warning message is displayed on the standard
error output, and the key/data pair are skipped.
.IP \fB\-P\fR
Specify an environment password.  Although Berkeley DB utilities overwrite
password strings as soon as possible, be aware there may be a window of
vulnerability on systems where unprivileged users can see command-line
arguments or where utilities are not able to overwrite the memory
containing the command-line arguments.
.IP \fB\-r\fR
Reset the database's file ID or log sequence numbers (LSNs).
.sp
All database pages in transactional environments contain references to
the environment's log records.  In order to copy a database into a
different database environment, database page references to the old
environment's log records must be reset, otherwise data corruption can
occur when the database is modified in the new environment.  The
\fB-r\fR \fBlsn\fR option resets a database's log sequence
numbers.
.sp
All databases contain an ID string used to identify the database in the
database environment cache.  If a database is copied, and used in the
same environment as another file with the same ID string, corruption can
occur.  The \fB-r\fR \fBfileid\fR  option resets a database's file
ID to a new value.
.sp
\fBIn both cases, the physical file specified by the file argument
is modified in-place.\fR
.IP \fB\-T\fR
The \fB-T\fR option allows non-Berkeley DB applications to easily load text
files into databases.
.sp
If the database to be created is of type Btree or Hash, or the keyword
\fBkeys\fR is specified as set, the input must be paired lines of text,
where the first line of the pair is the key item, and the second line of
the pair is its corresponding data item.  If the database to be created
is of type Queue or Recno and the keyword \fBkeys\fR is not set, the
input must be lines of text, where each line is a new data item for the
database.
.sp
A simple escape mechanism, where newline and backslash (\\)
characters are special, is applied to the text input.  Newline characters
are interpreted as record separators.  Backslash characters in the text
will be interpreted in one of two ways: If the backslash character
precedes another backslash character, the pair will be interpreted as a
literal backslash.  If the backslash character precedes any other
character, the two characters following the backslash will be interpreted
as a hexadecimal specification of a single character; for example,
\\0a is a newline character in the ASCII character set.
.sp
For this reason, any backslash or newline characters that naturally
occur in the text input must be escaped to avoid misinterpretation by
db5.3_load.
.sp
If the \fB-T\fR option is specified, the underlying access method type
must be specified using the \fB-t\fR option.
.IP \fB\-t\fR
Specify the underlying access method.  If no \fB-t\fR option is
specified, the database will be loaded into a database of the same type
as was dumped; for example, a Hash database will be created if a Hash
database was dumped.
.sp
Btree and Hash databases may be converted from one to the other.  Queue
and Recno databases may be converted from one to the other.  If the
\fB-k\fR option was specified on the call to db5.3_dump then Queue
and Recno databases may be converted to Btree or Hash, with the key being
the integer record number.
.IP \fB\-V\fR
Write the library version number to the standard output, and exit.
.PP
The db5.3_load utility may be used with a Berkeley DB environment (as described for the
\fB-h\fR option, the environment variable \fBDB_HOME\fR, 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, db5.3_load should always be given the chance to
detach from the environment and exit gracefully.  To cause db5.3_load
to release all environment resources and exit cleanly, send it an
interrupt signal (SIGINT).
.PP
The db5.3_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.
.SH EXAMPLES
The db5.3_load utility can be used to load text files into databases.
For example, the following command loads the standard UNIX
\fI/etc/passwd\fR file into a database, with the login name as the
key item and the entire password entry as the data item:
.PP
.TP 8
awk \-F: '{print $1; print $0}' < /etc/passwd |
sed 's/\\\\/\\\\\\\\/g' | db5.3_load \-T \-t hash passwd.db
.PP
Note that backslash characters naturally occurring in the text are escaped
to avoid interpretation as escape characters by db5.3_load.
.SH ENVIRONMENT
.IP \fBDB_HOME\fR
If the \fB-h\fR option is not specified and the environment variable
DB_HOME is set, it is used as the path of the database home, as described
in DB_ENV->open.
.SH SUPPORTED KEYWORDS
The following keywords are supported for the \fB-c\fR command-line
ption to the db5.3_load utility.  See DB->open for further
discussion of these keywords and what values should be specified.
.PP
The parenthetical listing specifies how the value part of the
\fBname=value\fR pair is interpreted.  Items listed as (boolean)
expect value to be \fB1\fR (set) or \fB0\fR (unset).  Items listed
as (number) convert value to a number.  Items listed as (string) use
the string value without modification.
.IP "bt_minkey (number)"
The minimum number of keys per page.
.IP "chksum (boolean)"
Enable page checksums.
.IP "database (string)"
The database to load.
.IP "db_lorder (number)"
The byte order for integers in the stored database metadata.
.IP "db_pagesize (number)"
The size of database pages, in bytes.
.IP "duplicates (boolean)"
The value of the DB_DUP flag.
.IP "dupsort (boolean)"
The value of the DB_DUPSORT flag.
.IP "extentsize (number)"
The size of database extents, in pages, for Queue databases configured
to use extents.
.IP "h_ffactor (number)"
The density within the Hash database.
.IP "h_nelem (number)"
The size of the Hash database.
.IP "keys (boolean)"
Specify whether keys are present for Queue or Recno databases.
.IP "re_len (number)"
Specify fixed-length records of the specified length.
.IP "re_pad (string)"
Specify the fixed-length record pad character.
.IP "recnum (boolean)"
The value of the DB_RECNUM flag.
.IP "renumber (boolean)"
The value of the DB_RENUMBER flag.
.IP "subdatabase (string)"
The subdatabase to load.

.SH AUTHORS
Sleepycat Software, Inc. This manual page was created based on
the HTML documentation for db_load from Sleepycat,
by Thijs Kinkhorst <thijs@kinkhorst.com>,
for the Debian system (but may be used by others).