1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
5 | %general-entities;
|
---|
6 |
|
---|
7 | <!ENTITY db-download-http "&sources-anduin-http;/bdb/db-&db-version;.tar.gz">
|
---|
8 | <!ENTITY db-download-ftp " ">
|
---|
9 | <!ENTITY db-md5sum "b99454564d5b4479750567031d66fe24">
|
---|
10 | <!ENTITY db-size "34 MB">
|
---|
11 | <!ENTITY db-buildsize "265 MB">
|
---|
12 | <!ENTITY db-time "0.6 SBU">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="db" xreflabel="Berkeley DB-&db-version;">
|
---|
16 | <?dbhtml filename="db.html"?>
|
---|
17 |
|
---|
18 |
|
---|
19 | <title>Berkeley DB-&db-version;</title>
|
---|
20 |
|
---|
21 | <indexterm zone="db">
|
---|
22 | <primary sortas="a-Berkeley-DB">Berkeley DB</primary>
|
---|
23 | </indexterm>
|
---|
24 |
|
---|
25 | <sect2 role="package">
|
---|
26 | <title>Introduction to Berkeley DB</title>
|
---|
27 |
|
---|
28 | <para>
|
---|
29 | The <application>Berkeley DB</application> package contains programs and
|
---|
30 | utilities used by many other applications for database related functions.
|
---|
31 | </para>
|
---|
32 |
|
---|
33 | &lfs120_checked;
|
---|
34 |
|
---|
35 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
36 | <itemizedlist spacing="compact">
|
---|
37 | <listitem>
|
---|
38 | <para>
|
---|
39 | Download (HTTP): <ulink url="&db-download-http;"/>
|
---|
40 | </para>
|
---|
41 | </listitem>
|
---|
42 | <listitem>
|
---|
43 | <para>
|
---|
44 | Download (FTP): <ulink url="&db-download-ftp;"/>
|
---|
45 | </para>
|
---|
46 | </listitem>
|
---|
47 | <listitem>
|
---|
48 | <para>
|
---|
49 | Download MD5 sum: &db-md5sum;
|
---|
50 | </para>
|
---|
51 | </listitem>
|
---|
52 | <listitem>
|
---|
53 | <para>
|
---|
54 | Download size: &db-size;
|
---|
55 | </para>
|
---|
56 | </listitem>
|
---|
57 | <listitem>
|
---|
58 | <para>
|
---|
59 | Estimated disk space required: &db-buildsize;
|
---|
60 | </para>
|
---|
61 | </listitem>
|
---|
62 | <listitem>
|
---|
63 | <para>
|
---|
64 | Estimated build time: &db-time;
|
---|
65 | </para>
|
---|
66 | </listitem>
|
---|
67 | </itemizedlist>
|
---|
68 |
|
---|
69 | <bridgehead renderas="sect3">Berkeley DB Dependencies</bridgehead>
|
---|
70 |
|
---|
71 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
72 | <para role="optional">
|
---|
73 | <!-- <xref linkend="tcl"/> and -->
|
---|
74 | <xref linkend="libnsl"/> and
|
---|
75 | <xref linkend="sharutils"/> (for the <command>uudecode</command> command)
|
---|
76 |
|
---|
77 | <!--,
|
---|
78 | <xref linkend="openjdk"/> or <xref linkend="java"/>, and
|
---|
79 | - - This is currently broken, removed for now. - -
|
---|
80 | <xref linkend="sharutils"/> (for the <command>uudecode</command> command
|
---|
81 | - Java bindings are required) -->
|
---|
82 | </para>
|
---|
83 |
|
---|
84 | </sect2>
|
---|
85 |
|
---|
86 | <!-- <sect2 role="testing">
|
---|
87 | <title>Testing Berkeley DB before the real install</title>
|
---|
88 |
|
---|
89 | <para>
|
---|
90 | If you can't wait 12 hours or so you may want to skip ahead to
|
---|
91 | <xref linkend="bdb-installation"/>. The test suite can take a long time
|
---|
92 | and has a few bugs causing a report of <quote>Regression tests
|
---|
93 | failed</quote>. However, running the test suite is a very exhaustive test
|
---|
94 | of your hardware, perhaps pushing your machine harder (especially disk
|
---|
95 | I/O) than it will ever see during production use. Note that you must have
|
---|
96 | <application>Tcl</application> installed to run the test suite.
|
---|
97 | </para>
|
---|
98 |
|
---|
99 | <para>
|
---|
100 | Build for the <application>Berkeley DB</application> test by running the
|
---|
101 | following commands:
|
---|
102 | </para>
|
---|
103 |
|
---|
104 | <screen><userinput>cd build_unix &&
|
---|
105 | ../dist/configure --prefix=/usr \
|
---|
106 | --enable-test \
|
---|
107 | --enable-tcl \
|
---|
108 | --enable-dbm \
|
---|
109 | --with-tcl=/usr/lib &&
|
---|
110 | make</userinput></screen>
|
---|
111 |
|
---|
112 | <para>
|
---|
113 | To test the results, start <command>tclsh</command>:
|
---|
114 | </para>
|
---|
115 |
|
---|
116 | <screen><userinput>tclsh</userinput></screen>
|
---|
117 |
|
---|
118 | <para>
|
---|
119 | From the <command>tclsh</command> prompt (<prompt>% </prompt>), run:
|
---|
120 | </para>
|
---|
121 |
|
---|
122 | <screen><userinput>source ../test/tcl/test.tcl
|
---|
123 | run_parallel 5 run_std
|
---|
124 | exit</userinput></screen>
|
---|
125 |
|
---|
126 | <para>
|
---|
127 | Clean up the source tree with the following command:
|
---|
128 | </para>
|
---|
129 |
|
---|
130 | <screen><userinput>make realclean &&
|
---|
131 | cd ..</userinput></screen>
|
---|
132 |
|
---|
133 | <note><para>
|
---|
134 | Test127.f and Repmgr026.c are known to fail.
|
---|
135 | </para></note>
|
---|
136 |
|
---|
137 | <para>
|
---|
138 | There are additional testing suites in the
|
---|
139 | <filename class="directory">test/c</filename> and
|
---|
140 | <filename class="directory">test/cxx</filename> directories. See the
|
---|
141 | <filename>README</filename> in each directory for instructions on how to
|
---|
142 | run the tests.
|
---|
143 | </para>
|
---|
144 | </sect2> -->
|
---|
145 |
|
---|
146 | <sect2 role="installation" id="bdb-installation">
|
---|
147 | <title>Installation of Berkeley DB</title>
|
---|
148 |
|
---|
149 | <para>
|
---|
150 | First apply a fix so that this will compile with current versions of
|
---|
151 | <command>g++</command>:
|
---|
152 | </para>
|
---|
153 |
|
---|
154 | <screen><userinput>sed -i 's/\(__atomic_compare_exchange\)/\1_db/' src/dbinc/atomic.h</userinput></screen>
|
---|
155 |
|
---|
156 | <!-- move parts of hte testing to here, possibly as sect3 -->
|
---|
157 |
|
---|
158 | <para>
|
---|
159 | Install <application>Berkeley DB</application> by running the following
|
---|
160 | commands:
|
---|
161 | </para>
|
---|
162 |
|
---|
163 | <screen><userinput>cd build_unix &&
|
---|
164 | ../dist/configure --prefix=/usr \
|
---|
165 | --enable-compat185 \
|
---|
166 | --enable-dbm \
|
---|
167 | --disable-static \
|
---|
168 | --enable-cxx &&
|
---|
169 | make</userinput></screen>
|
---|
170 |
|
---|
171 | <para>
|
---|
172 | Now, as the <systemitem class="username">root</systemitem> user:
|
---|
173 | </para>
|
---|
174 |
|
---|
175 | <screen role="root"><userinput>make docdir=/usr/share/doc/db-&db-version; install &&
|
---|
176 |
|
---|
177 | chown -v -R root:root \
|
---|
178 | /usr/bin/db_* \
|
---|
179 | /usr/include/db{,_185,_cxx}.h \
|
---|
180 | /usr/lib/libdb*.{so,la} \
|
---|
181 | /usr/share/doc/db-&db-version;</userinput></screen>
|
---|
182 | </sect2>
|
---|
183 |
|
---|
184 | <sect2 role="commands">
|
---|
185 | <title>Command Explanations</title>
|
---|
186 |
|
---|
187 | <para>
|
---|
188 | <command>cd build_unix && ../dist/configure
|
---|
189 | --prefix=/usr...</command>: This replaces the normal
|
---|
190 | <command>./configure</command> command, as
|
---|
191 | <application>Berkeley DB</application> comes with various build
|
---|
192 | directories for different platforms.
|
---|
193 | </para>
|
---|
194 |
|
---|
195 | <para>
|
---|
196 | <parameter>--enable-compat185</parameter>: This switch enables building
|
---|
197 | the DB-1.85 compatibility API.
|
---|
198 | </para>
|
---|
199 |
|
---|
200 | <para>
|
---|
201 | <parameter>--enable-cxx</parameter>: This switch enables building C++ API
|
---|
202 | libraries.
|
---|
203 | </para>
|
---|
204 |
|
---|
205 | <para>
|
---|
206 | <parameter>--enable-dbm</parameter>: Enables legacy interface support
|
---|
207 | needed by some older packages.
|
---|
208 | </para>
|
---|
209 |
|
---|
210 | <para>
|
---|
211 | <command>make docdir=/usr/share/doc/db-&db-version; install</command>:
|
---|
212 | This installs the documentation in the standard location instead of
|
---|
213 | <filename class="directory">/usr/docs</filename>.
|
---|
214 | </para>
|
---|
215 |
|
---|
216 | <para>
|
---|
217 | <command>chown -v -R root:root ...</command>:This command changes the
|
---|
218 | ownership of various installed files from the uid:gid of the builder to
|
---|
219 | root:root.
|
---|
220 | </para>
|
---|
221 |
|
---|
222 | <para>
|
---|
223 | <option>--enable-tcl --with-tcl=/usr/lib</option>: Enables
|
---|
224 | <application>Tcl</application> support in DB and creates the
|
---|
225 | <filename class="libraryfile">libdb_tcl</filename> libraries.
|
---|
226 | </para>
|
---|
227 |
|
---|
228 | <para>
|
---|
229 | <option>--enable-java</option>: Enables <application>Java</application>
|
---|
230 | support in DB and creates the
|
---|
231 | <filename class="libraryfile">libdb_java</filename> libraries.
|
---|
232 | <!--
|
---|
233 | checking if java works... yes
|
---|
234 | checking for javac... /opt/jdk/bin/javac
|
---|
235 | checking absolute path of javac... /opt/jdk/bin/javac
|
---|
236 | checking java version... 10.0.1
|
---|
237 | configure: error: Java version 1.3 or higher required, got 10.0.1
|
---|
238 | -->
|
---|
239 | Java support is currently broken with Java-&openjdk-build;.x and higher.
|
---|
240 | </para>
|
---|
241 | </sect2>
|
---|
242 |
|
---|
243 | <sect2 role="content">
|
---|
244 | <title>Contents</title>
|
---|
245 |
|
---|
246 | <segmentedlist>
|
---|
247 | <segtitle>Installed Programs</segtitle>
|
---|
248 | <segtitle>Installed Libraries</segtitle>
|
---|
249 | <segtitle>Installed Directory</segtitle>
|
---|
250 |
|
---|
251 | <seglistitem>
|
---|
252 | <seg>
|
---|
253 | db_archive,
|
---|
254 | db_checkpoint,
|
---|
255 | db_deadlock,
|
---|
256 | db_dump,
|
---|
257 | db_hotbackup,
|
---|
258 | db_load,
|
---|
259 | db_log_verify,
|
---|
260 | db_printlog,
|
---|
261 | db_recover,
|
---|
262 | db_replicate,
|
---|
263 | db_stat,
|
---|
264 | db_tuner,
|
---|
265 | db_upgrade, and
|
---|
266 | db_verify
|
---|
267 | </seg>
|
---|
268 | <seg>
|
---|
269 | libdb.so,
|
---|
270 | libdb_cxx.so, and
|
---|
271 | <!-- libdb_java.so, and -->
|
---|
272 | libdb_tcl.so
|
---|
273 | </seg>
|
---|
274 | <seg>/usr/share/doc/db-&db-version;</seg>
|
---|
275 | </seglistitem>
|
---|
276 | </segmentedlist>
|
---|
277 |
|
---|
278 | <variablelist>
|
---|
279 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
280 | <?dbfo list-presentation="list"?>
|
---|
281 | <?dbhtml list-presentation="table"?>
|
---|
282 |
|
---|
283 | <varlistentry id="db_archive">
|
---|
284 | <term><command>db_archive</command></term>
|
---|
285 | <listitem>
|
---|
286 | <para>
|
---|
287 | prints the pathnames of log files that are no longer in use
|
---|
288 | </para>
|
---|
289 | <indexterm zone="db db_archive">
|
---|
290 | <primary sortas="b-db_archive">db_archive</primary>
|
---|
291 | </indexterm>
|
---|
292 | </listitem>
|
---|
293 | </varlistentry>
|
---|
294 |
|
---|
295 | <varlistentry id="db_checkpoint">
|
---|
296 | <term><command>db_checkpoint</command></term>
|
---|
297 | <listitem>
|
---|
298 | <para>
|
---|
299 | is a daemon process used to monitor and checkpoint database logs
|
---|
300 | </para>
|
---|
301 | <indexterm zone="db db_checkpoint">
|
---|
302 | <primary sortas="b-db_checkpoint">db_checkpoint</primary>
|
---|
303 | </indexterm>
|
---|
304 | </listitem>
|
---|
305 | </varlistentry>
|
---|
306 |
|
---|
307 | <varlistentry id="db_deadlock">
|
---|
308 | <term><command>db_deadlock</command></term>
|
---|
309 | <listitem>
|
---|
310 | <para>
|
---|
311 | is used to abort lock requests when deadlocks are detected
|
---|
312 | </para>
|
---|
313 | <indexterm zone="db db_deadlock">
|
---|
314 | <primary sortas="b-db_deadlock">db_deadlock</primary>
|
---|
315 | </indexterm>
|
---|
316 | </listitem>
|
---|
317 | </varlistentry>
|
---|
318 |
|
---|
319 | <varlistentry id="db_dump">
|
---|
320 | <term><command>db_dump</command></term>
|
---|
321 | <listitem>
|
---|
322 | <para>
|
---|
323 | converts database files to a flat file format readable by
|
---|
324 | <command>db_load</command>
|
---|
325 | </para>
|
---|
326 | <indexterm zone="db db_dump">
|
---|
327 | <primary sortas="b-db_dump">db_dump</primary>
|
---|
328 | </indexterm>
|
---|
329 | </listitem>
|
---|
330 | </varlistentry>
|
---|
331 |
|
---|
332 | <varlistentry id="db_hotbackup">
|
---|
333 | <term><command>db_hotbackup</command></term>
|
---|
334 | <listitem>
|
---|
335 | <para>
|
---|
336 | creates "hot backup" or "hot failover" snapshots of Berkeley DB
|
---|
337 | databases
|
---|
338 | </para>
|
---|
339 | <indexterm zone="db db_hotbackup">
|
---|
340 | <primary sortas="b-db_hotbackup">db_hotbackup</primary>
|
---|
341 | </indexterm>
|
---|
342 | </listitem>
|
---|
343 | </varlistentry>
|
---|
344 |
|
---|
345 | <varlistentry id="db_load">
|
---|
346 | <term><command>db_load</command></term>
|
---|
347 | <listitem>
|
---|
348 | <para>
|
---|
349 | is used to create database files from flat files created with
|
---|
350 | <command>db_dump</command>
|
---|
351 | </para>
|
---|
352 | <indexterm zone="db db_load">
|
---|
353 | <primary sortas="b-db_load">db_load</primary>
|
---|
354 | </indexterm>
|
---|
355 | </listitem>
|
---|
356 | </varlistentry>
|
---|
357 |
|
---|
358 | <varlistentry id="db_log_verify">
|
---|
359 | <term><command>db_log_verify</command></term>
|
---|
360 | <listitem>
|
---|
361 | <para>
|
---|
362 | verifies the log files of a database
|
---|
363 | </para>
|
---|
364 | <indexterm zone="db db_log_verify">
|
---|
365 | <primary sortas="b-db_log_verify">db_log_verify</primary>
|
---|
366 | </indexterm>
|
---|
367 | </listitem>
|
---|
368 | </varlistentry>
|
---|
369 |
|
---|
370 | <varlistentry id="db_printlog">
|
---|
371 | <term><command>db_printlog</command></term>
|
---|
372 | <listitem>
|
---|
373 | <para>
|
---|
374 | converts database log files to human readable text
|
---|
375 | </para>
|
---|
376 | <indexterm zone="db db_printlog">
|
---|
377 | <primary sortas="b-db_printlog">db_printlog</primary>
|
---|
378 | </indexterm>
|
---|
379 | </listitem>
|
---|
380 | </varlistentry>
|
---|
381 |
|
---|
382 | <varlistentry id="db_recover">
|
---|
383 | <term><command>db_recover</command></term>
|
---|
384 | <listitem>
|
---|
385 | <para>
|
---|
386 | is used to restore a database to a consistent state after a failure
|
---|
387 | </para>
|
---|
388 | <indexterm zone="db db_recover">
|
---|
389 | <primary sortas="b-db_recover">db_recover</primary>
|
---|
390 | </indexterm>
|
---|
391 | </listitem>
|
---|
392 | </varlistentry>
|
---|
393 |
|
---|
394 | <varlistentry id="db_replicate">
|
---|
395 | <term><command>db_replicate</command></term>
|
---|
396 | <listitem>
|
---|
397 | <para>
|
---|
398 | is a daemon process that provides replication/HA services on a
|
---|
399 | transactional environment
|
---|
400 | </para>
|
---|
401 | <indexterm zone="db db_replicate">
|
---|
402 | <primary sortas="b-db_replicate">db_replicate</primary>
|
---|
403 | </indexterm>
|
---|
404 | </listitem>
|
---|
405 | </varlistentry>
|
---|
406 |
|
---|
407 | <varlistentry id="db_stat">
|
---|
408 | <term><command>db_stat</command></term>
|
---|
409 | <listitem>
|
---|
410 | <para>
|
---|
411 | displays database environment statistics
|
---|
412 | </para>
|
---|
413 | <indexterm zone="db db_stat">
|
---|
414 | <primary sortas="b-db_stat">db_stat</primary>
|
---|
415 | </indexterm>
|
---|
416 | </listitem>
|
---|
417 | </varlistentry>
|
---|
418 |
|
---|
419 | <varlistentry id="db_tuner">
|
---|
420 | <term><command>db_tuner</command></term>
|
---|
421 | <listitem>
|
---|
422 | <para>
|
---|
423 | analyzes the data in a btree database, and suggests a page size that
|
---|
424 | is likely to deliver optimal operation
|
---|
425 | </para>
|
---|
426 | <indexterm zone="db db_tuner">
|
---|
427 | <primary sortas="b-db_tuner">db_tuner</primary>
|
---|
428 | </indexterm>
|
---|
429 | </listitem>
|
---|
430 | </varlistentry>
|
---|
431 |
|
---|
432 | <varlistentry id="db_upgrade">
|
---|
433 | <term><command>db_upgrade</command></term>
|
---|
434 | <listitem>
|
---|
435 | <para>
|
---|
436 | is used to upgrade database files to a newer version of
|
---|
437 | <application>Berkeley DB</application>
|
---|
438 | </para>
|
---|
439 | <indexterm zone="db db_upgrade">
|
---|
440 | <primary sortas="b-db_upgrade">db_upgrade</primary>
|
---|
441 | </indexterm>
|
---|
442 | </listitem>
|
---|
443 | </varlistentry>
|
---|
444 |
|
---|
445 | <varlistentry id="db_verify">
|
---|
446 | <term><command>db_verify</command></term>
|
---|
447 | <listitem>
|
---|
448 | <para>
|
---|
449 | is used to run consistency checks on database files
|
---|
450 | </para>
|
---|
451 | <indexterm zone="db db_verify">
|
---|
452 | <primary sortas="b-db_verify">db_verify</primary>
|
---|
453 | </indexterm>
|
---|
454 | </listitem>
|
---|
455 | </varlistentry>
|
---|
456 | </variablelist>
|
---|
457 | </sect2>
|
---|
458 |
|
---|
459 | </sect1>
|
---|