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 "http://download-east.oracle.com/berkeley-db/db-&db-version;.tar.gz">
|
---|
8 | <!ENTITY db-download-ftp " ">
|
---|
9 | <!ENTITY db-md5sum "76fcbfeebfcd09ba0b4d96bfdf8d884d">
|
---|
10 | <!ENTITY db-size "30 MB">
|
---|
11 | <!ENTITY db-buildsize "267 MB (additional 170 MB to run parallel standard test suite with all bindings)">
|
---|
12 | <!ENTITY db-time "2.1 SBU (builds all bindings, add an additional 160 SBU to run parallel standard test suite)">
|
---|
13 | ]>
|
---|
14 |
|
---|
15 | <sect1 id="db" xreflabel="Berkeley DB-&db-version;">
|
---|
16 | <?dbhtml filename="db.html"?>
|
---|
17 |
|
---|
18 | <sect1info>
|
---|
19 | <othername>$LastChangedBy$</othername>
|
---|
20 | <date>$Date$</date>
|
---|
21 | </sect1info>
|
---|
22 |
|
---|
23 | <title>Berkeley DB-&db-version;</title>
|
---|
24 |
|
---|
25 | <indexterm zone="db">
|
---|
26 | <primary sortas="a-Berkeley-DB">Berkeley DB</primary>
|
---|
27 | </indexterm>
|
---|
28 |
|
---|
29 | <sect2 role="package">
|
---|
30 | <title>Introduction to Berkeley DB</title>
|
---|
31 |
|
---|
32 | <!-- <para>The <application>Berkeley DB</application> package contains programs
|
---|
33 | and utilities used by many other applications for database related
|
---|
34 | functions. This package is also installed during LFS and may already exist
|
---|
35 | on your system. It is listed here in BLFS as well because you may need to
|
---|
36 | reinstall it if you need the additional language bindings or the RPC
|
---|
37 | server. If you do reinstall <application>Berkeley DB</application>, ensure
|
---|
38 | you use the &lfs-bdb-version; version used in the LFS book.</para> -->
|
---|
39 |
|
---|
40 | <para>The <application>Berkeley DB</application> package contains programs
|
---|
41 | and utilities used by many other applications for database related
|
---|
42 | functions.</para>
|
---|
43 |
|
---|
44 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
45 | <itemizedlist spacing="compact">
|
---|
46 | <listitem>
|
---|
47 | <para>Download (HTTP): <ulink url="&db-download-http;"/></para>
|
---|
48 | </listitem>
|
---|
49 | <listitem>
|
---|
50 | <para>Download (FTP): <ulink url="&db-download-ftp;"/></para>
|
---|
51 | </listitem>
|
---|
52 | <listitem>
|
---|
53 | <para>Download MD5 sum: &db-md5sum;</para>
|
---|
54 | </listitem>
|
---|
55 | <listitem>
|
---|
56 | <para>Download size: &db-size;</para>
|
---|
57 | </listitem>
|
---|
58 | <listitem>
|
---|
59 | <para>Estimated disk space required: &db-buildsize;</para>
|
---|
60 | </listitem>
|
---|
61 | <listitem>
|
---|
62 | <para>Estimated build time: &db-time;</para>
|
---|
63 | </listitem>
|
---|
64 | </itemizedlist>
|
---|
65 |
|
---|
66 | <!-- <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
67 | <itemizedlist spacing="compact">
|
---|
68 | <listitem>
|
---|
69 | <para>Required patch: <ulink
|
---|
70 | url="http://www.oracle.com/technology/products/berkeley-db/db/update/&db-version;/patch.&db-version;.1"/></para>
|
---|
71 | </listitem>
|
---|
72 | <listitem>
|
---|
73 | <para>Required patch: <ulink
|
---|
74 | url="http://www.oracle.com/technology/products/berkeley-db/db/update/&db-version;/patch.&db-version;.2"/></para>
|
---|
75 | </listitem>
|
---|
76 | </itemizedlist> -->
|
---|
77 |
|
---|
78 | <bridgehead renderas="sect3">Berkeley DB Dependencies</bridgehead>
|
---|
79 |
|
---|
80 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
81 | <para role="optional"><xref linkend="tcl"/>, and
|
---|
82 | <xref linkend="icedtea6"/> or <xref linkend="jdk"/></para>
|
---|
83 |
|
---|
84 | <para condition="html" role="usernotes">User Notes:
|
---|
85 | <ulink url="&blfs-wiki;/db"/></para>
|
---|
86 |
|
---|
87 | </sect2>
|
---|
88 |
|
---|
89 | <sect2 role="testing">
|
---|
90 | <title>Testing Berkeley DB</title>
|
---|
91 |
|
---|
92 | <para>You may want to skip ahead to <xref linkend="bdb-installation"/>. The
|
---|
93 | test suite can take up to 150 SBUs and has a few bugs causing a report of
|
---|
94 | <quote>Regression tests failed</quote>. However, running the test suite is
|
---|
95 | a very exhaustive test of your hardware, perhaps pushing your machine
|
---|
96 | harder (especially disk I/O) than it will ever see during production use.
|
---|
97 | Note that you must have <application>Tcl</application> installed to run the
|
---|
98 | test suite.</para>
|
---|
99 |
|
---|
100 | <para>Build for the <application>Berkeley DB</application> test suite by
|
---|
101 | running the following commands (add <parameter>--enable-java</parameter> if
|
---|
102 | you wish to test the java bindings):</para>
|
---|
103 |
|
---|
104 | <screen><userinput>cd build_unix &&
|
---|
105 | uudecode="no" ../dist/configure --prefix=/usr \
|
---|
106 | --enable-test \
|
---|
107 | --enable-tcl \
|
---|
108 | --enable-sql \
|
---|
109 | --with-tcl=/usr/lib &&
|
---|
110 | make</userinput></screen>
|
---|
111 |
|
---|
112 | <para>To test <application>Berkeley DB</application>, issue the following
|
---|
113 | command:</para>
|
---|
114 |
|
---|
115 | <screen><userinput>echo "source ../test/tcl/test.tcl; run_parallel 5 run_std; exit;" | tclsh</userinput></screen>
|
---|
116 |
|
---|
117 | <para>Clean up the source tree with the following command:</para>
|
---|
118 |
|
---|
119 | <screen><userinput>make realclean &&
|
---|
120 | cd ..</userinput></screen>
|
---|
121 |
|
---|
122 | </sect2>
|
---|
123 |
|
---|
124 | <sect2 role="installation" id="bdb-installation">
|
---|
125 | <title>Installation of Berkeley DB</title>
|
---|
126 |
|
---|
127 | <!-- <para>The installation commands below are identical to the commands used
|
---|
128 | in the LFS book. If you installed <application>Berkeley DB</application>
|
---|
129 | in LFS, and you don't add anything to the <command>configure</command>
|
---|
130 | script, you'll end up with exactly what you already have. The additional
|
---|
131 | parameters you can use are listed in the Command Explanations section
|
---|
132 | below.</para>
|
---|
133 |
|
---|
134 | <note>
|
---|
135 | <para>If you plan on installing <application>Berkeley DB</application>
|
---|
136 | with Java support, you should check the system for certain versions
|
---|
137 | of <xref linkend="jdk"/> and <xref linkend="gmime"/>. Specifically, if
|
---|
138 | <application>JDK</application>-6 Update X and the
|
---|
139 | <command>uudecode</command> program from the
|
---|
140 | <application>GMime</application> program is on the system, the build will
|
---|
141 | fail (unless you run the modified <command>./configure</command> command
|
---|
142 | shown below). You can run two commands (<command>javac -version</command>
|
---|
143 | and <command>uudecode - -version</command>) to determine what versions are
|
---|
144 | installed. You can also download and run a shell script from
|
---|
145 | <ulink url="&files-anduin;/jdk-uudecode-check.sh"/> that will alert
|
---|
146 | you to a non-working condition. If the identified programs exist on the
|
---|
147 | system, you must modify the
|
---|
148 | <command>./configure</command> command as shown below.</para>
|
---|
149 |
|
---|
150 | <screen><userinput>uudecode="no" ../dist/configure - -(use the parameters shown below)</userinput></screen>
|
---|
151 | </note> -->
|
---|
152 |
|
---|
153 | <para>Install <application>Berkeley DB</application> by running the
|
---|
154 | following commands:</para>
|
---|
155 |
|
---|
156 | <screen><userinput>cd build_unix &&
|
---|
157 | uudecode="no" ../dist/configure --prefix=/usr \
|
---|
158 | --enable-compat185 \
|
---|
159 | --enable-cxx \
|
---|
160 | --enable-sql &&
|
---|
161 | make</userinput></screen>
|
---|
162 |
|
---|
163 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
164 |
|
---|
165 | <screen role="root"><userinput>make docdir=/usr/share/doc/db-&db-version; install &&
|
---|
166 | touch /usr/include/sqlite.h
|
---|
167 | chown -v -R root:root \
|
---|
168 | /usr/bin/db_* \
|
---|
169 | /usr/bin/dbsql \
|
---|
170 | /usr/include/db{,_185,_cxx,sql}.h \
|
---|
171 | /usr/lib/libdb{,_cxx,_sql}{.a,.so,-5.so,-5.1.{a,la,so}} \
|
---|
172 | /usr/share/doc/db-&db-version;</userinput></screen>
|
---|
173 |
|
---|
174 | <para>If you compiled <application>Berkeley DB</application> with
|
---|
175 | <application>TCL</application> support, complete the
|
---|
176 | <application>TCL</application> installation with the following commands
|
---|
177 | while still the <systemitem class="username">root</systemitem> user:</para>
|
---|
178 |
|
---|
179 | <screen role="root"><userinput>chown -v root:root \
|
---|
180 | /usr/lib/libdb_tcl{.a,.so,-5.so,-5.1.{a,la,so}}</userinput></screen>
|
---|
181 |
|
---|
182 | <para>If you compiled <application>Berkeley DB</application> with
|
---|
183 | <application>Java</application> support, complete the
|
---|
184 | <application>Java</application> installation with the following commands
|
---|
185 | while still the <systemitem class="username">root</systemitem> user:</para>
|
---|
186 |
|
---|
187 | <screen role="root"><userinput>chown -v root:root \
|
---|
188 | /usr/lib/libdb_java{.so,-5.so,-5.1{.a,.la,.so,_g.so}} \
|
---|
189 | /usr/lib/db.jar</userinput></screen>
|
---|
190 |
|
---|
191 | <para>Finaly, if you've configured <application>Berkeley DB</application>
|
---|
192 | with the <parameter>--enable-sql_compat</parameter> parameter to provide
|
---|
193 | <application>SQLite3</application> compatibility, complete the installation
|
---|
194 | with the following commands while still the
|
---|
195 | <systemitem class="username">root</systemitem> user:</para>
|
---|
196 |
|
---|
197 | <screen role="root"><userinput>touch /usr/include/sqlite3.h &&
|
---|
198 | chown -v root:root \
|
---|
199 | /usr/bin/sqlite3 \
|
---|
200 | /usr/include/sqlite3.h \
|
---|
201 | /usr/lib/libsqlite3.{a,la,so}</userinput></screen>
|
---|
202 |
|
---|
203 | </sect2>
|
---|
204 |
|
---|
205 | <sect2 role="commands">
|
---|
206 | <title>Command Explanations</title>
|
---|
207 |
|
---|
208 | <para><command>cd build_unix &&
|
---|
209 | uudecode="no" ../dist/configure --prefix=/usr...</command>:
|
---|
210 | This replaces the normal <command>./configure</command> command, as
|
---|
211 | <application>Berkeley DB</application> comes with various
|
---|
212 | build directories for different platforms. The additional
|
---|
213 | <envar>uudecode="no"</envar> environment variable ensures that
|
---|
214 | the build will complete if <xref linkend="gmime"/> is intsalled.</para>
|
---|
215 |
|
---|
216 | <para><parameter>--enable-compat185</parameter>: This switch enables
|
---|
217 | building the DB-1.85 compatibility API.</para>
|
---|
218 |
|
---|
219 | <para><parameter>--enable-cxx</parameter>: This switch enables building
|
---|
220 | C++ API libraries.</para>
|
---|
221 |
|
---|
222 | <para><parameter>--enable-tcl --with-tcl=/usr/lib</parameter>:
|
---|
223 | Enables <application>Tcl</application> support in DB and creates the
|
---|
224 | <filename class="libraryfile">libdb_tcl</filename> libraries.</para>
|
---|
225 |
|
---|
226 | <para><parameter>--enable-java</parameter>: Enables
|
---|
227 | <application>Java</application> support in DB and creates the
|
---|
228 | <filename class='libraryfile'>libdb_java</filename> libraries.</para>
|
---|
229 |
|
---|
230 | <para><parameter>--enable-sql</parameter>: Enables SQL support in
|
---|
231 | DB and creates the <filename class='libraryfile'>libdb_sql</filename>
|
---|
232 | libraries.</para>
|
---|
233 |
|
---|
234 | <para><parameter>--enable-sql_compat</parameter>: enables building of the
|
---|
235 | <application>SQLite3</application> compatible binaries and libs.</para>
|
---|
236 |
|
---|
237 | <para><command>make docdir=/usr/share/doc/db-&db-version;
|
---|
238 | install</command>: This installs the documentation in
|
---|
239 | the standard location instead of
|
---|
240 | <filename class='directory'>/usr/docs</filename>.</para>
|
---|
241 |
|
---|
242 | <para><command>chown -v -R root:root ...</command>:These commands change
|
---|
243 | the ownership of various installed files from the uid:gid of the
|
---|
244 | builder to root:root.</para>
|
---|
245 |
|
---|
246 | <para><command>touch /usr/include/sqlite3.h</command>: This command updates
|
---|
247 | the timestamp of the installed sqlite3 header.</para>
|
---|
248 |
|
---|
249 | </sect2>
|
---|
250 |
|
---|
251 | <sect2 role="content">
|
---|
252 | <title>Contents</title>
|
---|
253 |
|
---|
254 | <!-- <para>Only the program and libraries not installed in LFS are listed here,
|
---|
255 | the others can be found at <ulink
|
---|
256 | url="&lfs-root;/chapter06/db.html#contents-db"/> as they were initially
|
---|
257 | installed during the building of LFS.</para> -->
|
---|
258 |
|
---|
259 | <segmentedlist>
|
---|
260 | <segtitle>Installed Programs</segtitle>
|
---|
261 | <segtitle>Installed Libraries</segtitle>
|
---|
262 | <segtitle>Installed Directory</segtitle>
|
---|
263 |
|
---|
264 | <seglistitem>
|
---|
265 | <seg>db_archive, db_checkpoint, db_deadlock, db_dump,
|
---|
266 | db_load, db_printlog, db_recover, db_stat, db_upgrade, db_verify,
|
---|
267 | dbsql, sqlite3</seg>
|
---|
268 | <seg>libdb.{so,a}, libdb_cxx.{so,a}, libdb_java{_g.so,.{so,a},
|
---|
269 | libdb_tcl.{so,a}, libdb_sql.{so.a} and db.jar</seg>
|
---|
270 | <seg>/usr/share/doc/db-&db-version;</seg>
|
---|
271 | </seglistitem>
|
---|
272 | </segmentedlist>
|
---|
273 |
|
---|
274 | <variablelist>
|
---|
275 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
276 | <?dbfo list-presentation="list"?>
|
---|
277 | <?dbhtml list-presentation="table"?>
|
---|
278 |
|
---|
279 | <varlistentry id="db_archive">
|
---|
280 | <term><command>db_archive</command></term>
|
---|
281 | <listitem>
|
---|
282 | <para>prints the pathnames of log files that are no longer in
|
---|
283 | use.</para>
|
---|
284 | <indexterm zone="db db_archive">
|
---|
285 | <primary sortas="b-db_archive">db_archive</primary>
|
---|
286 | </indexterm>
|
---|
287 | </listitem>
|
---|
288 | </varlistentry>
|
---|
289 |
|
---|
290 | <varlistentry id="db_checkpoint">
|
---|
291 | <term><command>db_checkpoint</command></term>
|
---|
292 | <listitem>
|
---|
293 | <para>is a daemon process used to monitor and checkpoint database
|
---|
294 | logs.</para>
|
---|
295 | <indexterm zone="db db_checkpoint">
|
---|
296 | <primary sortas="b-db_checkpoint">db_checkpoint</primary>
|
---|
297 | </indexterm>
|
---|
298 | </listitem>
|
---|
299 | </varlistentry>
|
---|
300 |
|
---|
301 | <varlistentry id="db_deadlock">
|
---|
302 | <term><command>db_deadlock</command></term>
|
---|
303 | <listitem>
|
---|
304 | <para>is used to abort lock requests when deadlocks are
|
---|
305 | detected.</para>
|
---|
306 | <indexterm zone="db db_deadlock">
|
---|
307 | <primary sortas="b-db_deadlock">db_deadlock</primary>
|
---|
308 | </indexterm>
|
---|
309 | </listitem>
|
---|
310 | </varlistentry>
|
---|
311 |
|
---|
312 | <varlistentry id="db_dump">
|
---|
313 | <term><command>db_dump</command></term>
|
---|
314 | <listitem>
|
---|
315 | <para>converts database files to a flat file format readable by
|
---|
316 | <command>db_load</command>.</para>
|
---|
317 | <indexterm zone="db db_dump">
|
---|
318 | <primary sortas="b-db_dump">db_dump</primary>
|
---|
319 | </indexterm>
|
---|
320 | </listitem>
|
---|
321 | </varlistentry>
|
---|
322 |
|
---|
323 | <varlistentry id="db_load">
|
---|
324 | <term><command>db_load</command></term>
|
---|
325 | <listitem>
|
---|
326 | <para>is used to create database files from flat files created with
|
---|
327 | <command>db_dump</command>.</para>
|
---|
328 | <indexterm zone="db db_load">
|
---|
329 | <primary sortas="b-db_load">db_load</primary>
|
---|
330 | </indexterm>
|
---|
331 | </listitem>
|
---|
332 | </varlistentry>
|
---|
333 |
|
---|
334 | <varlistentry id="db_printlog">
|
---|
335 | <term><command>db_printlog</command></term>
|
---|
336 | <listitem>
|
---|
337 | <para>converts database log files to human readable text.</para>
|
---|
338 | <indexterm zone="db db_printlog">
|
---|
339 | <primary sortas="b-db_printlog">db_printlog</primary>
|
---|
340 | </indexterm>
|
---|
341 | </listitem>
|
---|
342 | </varlistentry>
|
---|
343 |
|
---|
344 | <varlistentry id="db_recover">
|
---|
345 | <term><command>db_recover</command></term>
|
---|
346 | <listitem>
|
---|
347 | <para>is used to restore a database to a consistent state after a
|
---|
348 | failure.</para>
|
---|
349 | <indexterm zone="db db_recover">
|
---|
350 | <primary sortas="b-db_recover">db_recover</primary>
|
---|
351 | </indexterm>
|
---|
352 | </listitem>
|
---|
353 | </varlistentry>
|
---|
354 |
|
---|
355 | <varlistentry id="db_stat">
|
---|
356 | <term><command>db_stat</command></term>
|
---|
357 | <listitem>
|
---|
358 | <para>displays database environment statistics.</para>
|
---|
359 | <indexterm zone="db db_stat">
|
---|
360 | <primary sortas="b-db_stat">db_stat</primary>
|
---|
361 | </indexterm>
|
---|
362 | </listitem>
|
---|
363 | </varlistentry>
|
---|
364 |
|
---|
365 | <varlistentry id="db_upgrade">
|
---|
366 | <term><command>db_upgrade</command></term>
|
---|
367 | <listitem>
|
---|
368 | <para>is used to upgrade database files to a newer version of
|
---|
369 | <application>Berkeley DB</application>.</para>
|
---|
370 | <indexterm zone="db db_upgrade">
|
---|
371 | <primary sortas="b-db_upgrade">db_upgrade</primary>
|
---|
372 | </indexterm>
|
---|
373 | </listitem>
|
---|
374 | </varlistentry>
|
---|
375 |
|
---|
376 | <varlistentry id="db_verify">
|
---|
377 | <term><command>db_verify</command></term>
|
---|
378 | <listitem>
|
---|
379 | <para>is used to run consistency checks on database files.</para>
|
---|
380 | <indexterm zone="db db_verify">
|
---|
381 | <primary sortas="b-db_verify">db_verify</primary>
|
---|
382 | </indexterm>
|
---|
383 | </listitem>
|
---|
384 | </varlistentry>
|
---|
385 |
|
---|
386 | <varlistentry id="dbsql">
|
---|
387 | <term><command>dbsql</command></term>
|
---|
388 | <listitem>
|
---|
389 | <para>is a terminal-based front-end to the dbsql library that can
|
---|
390 | evaluate queries interactively and display the results.</para>
|
---|
391 | <indexterm zone="db dbsql">
|
---|
392 | <primary sortas="b-dbsql">dbsql</primary>
|
---|
393 | </indexterm>
|
---|
394 | </listitem>
|
---|
395 | </varlistentry>
|
---|
396 |
|
---|
397 | <varlistentry id="db_sqlite3">
|
---|
398 | <term><command>sqlite3</command></term>
|
---|
399 | <listitem>
|
---|
400 | <para>is a SQLite3 compatable inteface for dbsql.</para>
|
---|
401 | <indexterm zone="db sqlite3">
|
---|
402 | <primary sortas="b-sqlite3">sqlite3</primary>
|
---|
403 | </indexterm>
|
---|
404 | </listitem>
|
---|
405 | </varlistentry>
|
---|
406 |
|
---|
407 | </variablelist>
|
---|
408 |
|
---|
409 | </sect2>
|
---|
410 |
|
---|
411 | </sect1>
|
---|