[08254fc] | 1 | <?xml version="1.0" encoding="ISO-8859-1"?>
|
---|
[6732c094] | 2 | <!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
|
---|
| 3 | "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
|
---|
[08254fc] | 4 | <!ENTITY % general-entities SYSTEM "../../general.ent">
|
---|
| 5 | %general-entities;
|
---|
[0aeb696] | 6 |
|
---|
[8dbe2b6] | 7 | <!ENTITY db-download-http "http://download-east.oracle.com/berkeley-db/db-&db-version;.tar.gz">
|
---|
[fb2e525] | 8 | <!ENTITY db-download-ftp "&gentoo-ftp-repo;/db-&db-version;.tar.gz">
|
---|
[8dbe2b6] | 9 | <!ENTITY db-md5sum "b0f1c777708cb8e9d37fb47e7ed3312d">
|
---|
| 10 | <!ENTITY db-size "9.2 MB">
|
---|
| 11 | <!ENTITY db-buildsize "94 MB (additional 100 MB to run parallel standard test suite)">
|
---|
| 12 | <!ENTITY db-time "1.7 SBU (builds all bindings, add an additional 145 SBU to run parallel standard test suite)">
|
---|
[08254fc] | 13 | ]>
|
---|
| 14 |
|
---|
[317034a] | 15 | <sect1 id="db" xreflabel="Berkeley DB-&db-version;">
|
---|
[b742c85] | 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
|
---|
[2a038b2] | 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
|
---|
[55fb7f56] | 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>
|
---|
[b742c85] | 39 |
|
---|
| 40 | <bridgehead renderas="sect3">Package Information</bridgehead>
|
---|
| 41 | <itemizedlist spacing="compact">
|
---|
| 42 | <listitem>
|
---|
| 43 | <para>Download (HTTP): <ulink url="&db-download-http;"/></para>
|
---|
| 44 | </listitem>
|
---|
| 45 | <listitem>
|
---|
| 46 | <para>Download (FTP): <ulink url="&db-download-ftp;"/></para>
|
---|
| 47 | </listitem>
|
---|
| 48 | <listitem>
|
---|
| 49 | <para>Download MD5 sum: &db-md5sum;</para>
|
---|
| 50 | </listitem>
|
---|
| 51 | <listitem>
|
---|
| 52 | <para>Download size: &db-size;</para>
|
---|
| 53 | </listitem>
|
---|
| 54 | <listitem>
|
---|
| 55 | <para>Estimated disk space required: &db-buildsize;</para>
|
---|
| 56 | </listitem>
|
---|
| 57 | <listitem>
|
---|
| 58 | <para>Estimated build time: &db-time;</para>
|
---|
| 59 | </listitem>
|
---|
| 60 | </itemizedlist>
|
---|
| 61 |
|
---|
[ada64bf] | 62 | <bridgehead renderas="sect3">Additional Downloads</bridgehead>
|
---|
[864b24de] | 63 | <itemizedlist spacing="compact">
|
---|
| 64 | <listitem>
|
---|
[ada64bf] | 65 | <para>Required patch: <ulink
|
---|
[8dbe2b6] | 66 | url="http://www.oracle.com/technology/products/berkeley-db/db/update/&db-version;/patch.&db-version;.1"/></para>
|
---|
[ada64bf] | 67 | </listitem>
|
---|
[864b24de] | 68 | <listitem>
|
---|
[ada64bf] | 69 | <para>Required patch: <ulink
|
---|
[8dbe2b6] | 70 | url="http://www.oracle.com/technology/products/berkeley-db/db/update/&db-version;/patch.&db-version;.2"/></para>
|
---|
[ada64bf] | 71 | </listitem>
|
---|
| 72 | </itemizedlist>
|
---|
| 73 |
|
---|
[b742c85] | 74 | <bridgehead renderas="sect3">Berkeley DB Dependencies</bridgehead>
|
---|
| 75 |
|
---|
| 76 | <bridgehead renderas="sect4">Optional</bridgehead>
|
---|
[2a038b2] | 77 | <para role="optional"><xref linkend="tcl"/>,
|
---|
| 78 | <xref linkend="jdk"/>, and
|
---|
[472ae882] | 79 | <ulink url="http://www.gnu.org/software/sharutils/">sharutils</ulink>
|
---|
| 80 | (for the <command>uudecode</command> command)</para>
|
---|
[b742c85] | 81 |
|
---|
[3cb0c57] | 82 | <para condition="html" role="usernotes">User Notes:
|
---|
| 83 | <ulink url="&blfs-wiki;/db"/></para>
|
---|
| 84 |
|
---|
[b742c85] | 85 | </sect2>
|
---|
| 86 |
|
---|
[ac3ee9f8] | 87 | <sect2 role="testing">
|
---|
| 88 | <title>Testing Berkeley DB</title>
|
---|
| 89 |
|
---|
[2a038b2] | 90 | <para>You may want to skip ahead to <xref linkend="bdb-installation"/>. The
|
---|
| 91 | test suite can take up to 150 SBUs and has a few bugs causing a report of
|
---|
| 92 | <quote>Regression tests failed</quote>. However, running the test suite is
|
---|
| 93 | a very exhaustive test of your hardware, perhaps pushing your machine
|
---|
| 94 | harder (especially disk I/O) than it will ever see during production use.
|
---|
| 95 | Note that you must have <application>Tcl</application> installed to run the
|
---|
| 96 | test suite.</para>
|
---|
[ac3ee9f8] | 97 |
|
---|
| 98 | <para>Build for the <application>Berkeley DB</application> test by running
|
---|
| 99 | the following commands:</para>
|
---|
| 100 |
|
---|
[8dbe2b6] | 101 | <screen><userinput>patch -Np0 -i ../patch.&db-version;.1 &&
|
---|
| 102 | patch -Np0 -i ../patch.&db-version;.2 &&
|
---|
[ada64bf] | 103 | cd build_unix &&
|
---|
[4e7b1578] | 104 | ../dist/configure --prefix=/usr \
|
---|
| 105 | --enable-test \
|
---|
| 106 | --enable-tcl \
|
---|
| 107 | --with-tcl=/usr/lib &&
|
---|
[2a038b2] | 108 | make</userinput></screen>
|
---|
[ac3ee9f8] | 109 |
|
---|
[8d288fe8] | 110 | <para>To test the results, start <command>tclsh</command>:</para>
|
---|
[bccbdaea] | 111 |
|
---|
[8d288fe8] | 112 | <screen><userinput>tclsh</userinput></screen>
|
---|
| 113 |
|
---|
[4e7b1578] | 114 | <para>From the <command>tclsh</command> prompt (<prompt>% </prompt>),
|
---|
[2a038b2] | 115 | run:</para>
|
---|
[ac3ee9f8] | 116 |
|
---|
[4e7b1578] | 117 | <screen><userinput>source ../test/test.tcl
|
---|
| 118 | run_parallel 5 run_std
|
---|
| 119 | exit</userinput></screen>
|
---|
[ac3ee9f8] | 120 |
|
---|
[2a038b2] | 121 | <para>Clean up the source tree with the following command:</para>
|
---|
[ac3ee9f8] | 122 |
|
---|
[2c2f849] | 123 | <screen><userinput>make realclean &&
|
---|
[8d288fe8] | 124 | cd ..</userinput></screen>
|
---|
[2c2f849] | 125 |
|
---|
| 126 | </sect2>
|
---|
| 127 |
|
---|
[2a038b2] | 128 | <sect2 role="installation" id="bdb-installation">
|
---|
[2c2f849] | 129 | <title>Installation of Berkeley DB</title>
|
---|
| 130 |
|
---|
[4e7b1578] | 131 | <para>The installation commands below are identical to the commands used
|
---|
| 132 | in the LFS book. If you installed <application>Berkeley DB</application>
|
---|
| 133 | in LFS, and you don't add anything to the <command>configure</command>
|
---|
| 134 | script, you'll end up with exactly what you already have. The additional
|
---|
| 135 | parameters you can use are listed in the Command Explanations section
|
---|
[f53134c] | 136 | below.</para>
|
---|
| 137 |
|
---|
| 138 | <note>
|
---|
| 139 | <para>If you plan on installing <application>Berkeley DB</application>
|
---|
| 140 | with Java support, you should check the system for certain versions
|
---|
| 141 | of <xref linkend="jdk"/> and <xref linkend="gmime"/>. Specifically, if
|
---|
| 142 | <application>JDK</application>-6 Update X and the
|
---|
| 143 | <command>uudecode</command> program from the
|
---|
| 144 | <application>GMime</application> program is on the system, the build will
|
---|
| 145 | fail (unless you run the modified <command>./configure</command> command
|
---|
| 146 | shown below). You can run two commands (<command>javac -version</command>
|
---|
| 147 | and <command>uudecode --version</command>) to determine what versions are
|
---|
| 148 | installed. You can also download and run a shell script from
|
---|
| 149 | <ulink url="&files-anduin;/jdk-uudecode-check.sh"/> that will alert
|
---|
| 150 | you to a non-working condition. If the identified programs exist on the
|
---|
| 151 | system, you must modify the
|
---|
| 152 | <command>./configure</command> command as shown below.</para>
|
---|
| 153 |
|
---|
| 154 | <screen><userinput>uudecode="no" ../dist/configure --(use the parameters shown below)</userinput></screen>
|
---|
| 155 | </note>
|
---|
| 156 |
|
---|
| 157 | <para>Install <application>Berkeley DB</application> by running the
|
---|
[2c2f849] | 158 | following commands:</para>
|
---|
| 159 |
|
---|
[8dbe2b6] | 160 | <screen><userinput>patch -Np0 -i ../patch.&db-version;.1 &&
|
---|
| 161 | patch -Np0 -i ../patch.&db-version;.2 &&
|
---|
[ada64bf] | 162 | cd build_unix &&
|
---|
[2c2f849] | 163 | ../dist/configure --prefix=/usr \
|
---|
[2a038b2] | 164 | --enable-compat185 \
|
---|
| 165 | --enable-cxx &&
|
---|
| 166 | make</userinput></screen>
|
---|
[2c2f849] | 167 |
|
---|
| 168 | <para>Now, as the <systemitem class="username">root</systemitem> user:</para>
|
---|
| 169 |
|
---|
| 170 | <screen role="root"><userinput>make docdir=/usr/share/doc/db-&db-version; install &&
|
---|
[35a18d26] | 171 | chown -v -R root:root \
|
---|
| 172 | /usr/bin/berkeley_db_svc \
|
---|
| 173 | /usr/bin/db_* \
|
---|
| 174 | /usr/include/db{,_185,_cxx}.h \
|
---|
| 175 | /usr/lib/libdb{{,_cxx}.a,{,_cxx,_java,_tcl}-4.5.{so,a,la}} \
|
---|
| 176 | /usr/share/doc/db-&db-version;</userinput></screen>
|
---|
[ac3ee9f8] | 177 |
|
---|
| 178 | </sect2>
|
---|
| 179 |
|
---|
[b742c85] | 180 | <sect2 role="commands">
|
---|
| 181 | <title>Command Explanations</title>
|
---|
| 182 |
|
---|
| 183 | <para><command>cd build_unix &&
|
---|
| 184 | ../dist/configure --prefix=/usr...</command>:
|
---|
| 185 | This replaces the normal <command>./configure</command> command, as
|
---|
| 186 | <application>Berkeley DB</application> comes with various
|
---|
| 187 | build directories for different platforms.</para>
|
---|
| 188 |
|
---|
| 189 | <para><parameter>--enable-compat185</parameter>: This switch enables
|
---|
[2a038b2] | 190 | building the DB-1.85 compatibility API.</para>
|
---|
[b742c85] | 191 |
|
---|
| 192 | <para><parameter>--enable-cxx</parameter>: This switch enables building
|
---|
| 193 | C++ API libraries.</para>
|
---|
| 194 |
|
---|
[ac3ee9f8] | 195 | <para><parameter>--enable-tcl --with-tcl=/usr/lib</parameter>:
|
---|
[b742c85] | 196 | Enables <application>Tcl</application> support in DB and creates the
|
---|
| 197 | <filename class="libraryfile">libdb_tcl</filename> libraries.</para>
|
---|
| 198 |
|
---|
[ac3ee9f8] | 199 | <para><parameter>--enable-java</parameter>: Enables
|
---|
[b742c85] | 200 | <application>Java</application> support in DB and creates the
|
---|
| 201 | <filename class='libraryfile'>libdb_java</filename> libraries.</para>
|
---|
| 202 |
|
---|
[ac3ee9f8] | 203 | <para><parameter>--enable-rpc</parameter>: Enables building the
|
---|
[b742c85] | 204 | <application>Berkeley DB</application> RPC server.</para>
|
---|
| 205 |
|
---|
[ac3ee9f8] | 206 | <para><command>make docdir=/usr/share/doc/db-&db-version;
|
---|
| 207 | install</command>: This installs the documentation in
|
---|
[35a18d26] | 208 | the standard location instead of
|
---|
[2a038b2] | 209 | <filename class='directory'>/usr/docs</filename>.</para>
|
---|
[ac3ee9f8] | 210 |
|
---|
[35a18d26] | 211 | <para><command>chown -v -R root:root ...</command>:This command changes
|
---|
| 212 | the ownership of various installed files from the uid:gid of the
|
---|
| 213 | builder to root:root.</para>
|
---|
[0635d22] | 214 |
|
---|
[b742c85] | 215 | </sect2>
|
---|
| 216 |
|
---|
| 217 | <sect2 role="content">
|
---|
| 218 | <title>Contents</title>
|
---|
| 219 |
|
---|
[2a038b2] | 220 | <para>Only the program and libraries not installed in LFS are listed here,
|
---|
| 221 | the others can be found at <ulink
|
---|
| 222 | url="&lfs-root;/chapter06/db.html#contents-db"/> as they were initially
|
---|
| 223 | installed during the building of LFS.</para>
|
---|
| 224 |
|
---|
[b742c85] | 225 | <segmentedlist>
|
---|
[2a038b2] | 226 | <segtitle>Installed Program</segtitle>
|
---|
[b742c85] | 227 | <segtitle>Installed Libraries</segtitle>
|
---|
| 228 | <segtitle>Installed Directory</segtitle>
|
---|
| 229 |
|
---|
| 230 | <seglistitem>
|
---|
[2a038b2] | 231 | <seg>berkeley_db_svc</seg>
|
---|
[35a18d26] | 232 | <seg>libdb_java.{so,a}, libdb_tcl.{so,a} and db.jar</seg>
|
---|
[b742c85] | 233 | <seg>/usr/share/doc/db-&db-version;</seg>
|
---|
| 234 | </seglistitem>
|
---|
| 235 | </segmentedlist>
|
---|
| 236 |
|
---|
| 237 | <variablelist>
|
---|
| 238 | <bridgehead renderas="sect3">Short Descriptions</bridgehead>
|
---|
| 239 | <?dbfo list-presentation="list"?>
|
---|
| 240 | <?dbhtml list-presentation="table"?>
|
---|
| 241 |
|
---|
| 242 | <varlistentry id="berkeley_db_svc">
|
---|
| 243 | <term><command>berkeley_db_svc</command></term>
|
---|
| 244 | <listitem>
|
---|
| 245 | <para>is the <application>Berkeley DB</application>
|
---|
| 246 | RPC server.</para>
|
---|
| 247 | <indexterm zone="db berkeley_db_svc">
|
---|
| 248 | <primary sortas="b-berkeley_db_svc">berkeley_db_svc</primary>
|
---|
| 249 | </indexterm>
|
---|
| 250 | </listitem>
|
---|
| 251 | </varlistentry>
|
---|
| 252 |
|
---|
[2a038b2] | 253 | <!-- These are left in so that if LFS ever dumps BDB, it is easy to
|
---|
| 254 | restore this information
|
---|
| 255 |
|
---|
[b742c85] | 256 | <varlistentry id="db_archive">
|
---|
| 257 | <term><command>db_archive</command></term>
|
---|
| 258 | <listitem>
|
---|
| 259 | <para>prints the pathnames of log files that are no longer in
|
---|
| 260 | use.</para>
|
---|
| 261 | <indexterm zone="db db_archive">
|
---|
| 262 | <primary sortas="b-db_archive">db_archive</primary>
|
---|
| 263 | </indexterm>
|
---|
| 264 | </listitem>
|
---|
| 265 | </varlistentry>
|
---|
| 266 |
|
---|
| 267 | <varlistentry id="db_checkpoint">
|
---|
| 268 | <term><command>db_checkpoint</command></term>
|
---|
| 269 | <listitem>
|
---|
| 270 | <para>is a daemon process used to monitor and checkpoint database
|
---|
| 271 | logs.</para>
|
---|
| 272 | <indexterm zone="db db_checkpoint">
|
---|
| 273 | <primary sortas="b-db_checkpoint">db_checkpoint</primary>
|
---|
| 274 | </indexterm>
|
---|
| 275 | </listitem>
|
---|
| 276 | </varlistentry>
|
---|
| 277 |
|
---|
| 278 | <varlistentry id="db_deadlock">
|
---|
| 279 | <term><command>db_deadlock</command></term>
|
---|
| 280 | <listitem>
|
---|
| 281 | <para>is used to abort lock requests when deadlocks are
|
---|
| 282 | detected.</para>
|
---|
| 283 | <indexterm zone="db db_deadlock">
|
---|
| 284 | <primary sortas="b-db_deadlock">db_deadlock</primary>
|
---|
| 285 | </indexterm>
|
---|
| 286 | </listitem>
|
---|
| 287 | </varlistentry>
|
---|
| 288 |
|
---|
| 289 | <varlistentry id="db_dump">
|
---|
| 290 | <term><command>db_dump</command></term>
|
---|
| 291 | <listitem>
|
---|
| 292 | <para>converts database files to a flat file format readable by
|
---|
| 293 | <command>db_load</command>.</para>
|
---|
| 294 | <indexterm zone="db db_dump">
|
---|
| 295 | <primary sortas="b-db_dump">db_dump</primary>
|
---|
| 296 | </indexterm>
|
---|
| 297 | </listitem>
|
---|
| 298 | </varlistentry>
|
---|
| 299 |
|
---|
| 300 | <varlistentry id="db_load">
|
---|
| 301 | <term><command>db_load</command></term>
|
---|
| 302 | <listitem>
|
---|
| 303 | <para>is used to create database files from flat files created with
|
---|
| 304 | <command>db_dump</command>.</para>
|
---|
| 305 | <indexterm zone="db db_load">
|
---|
| 306 | <primary sortas="b-db_load">db_load</primary>
|
---|
| 307 | </indexterm>
|
---|
| 308 | </listitem>
|
---|
| 309 | </varlistentry>
|
---|
| 310 |
|
---|
| 311 | <varlistentry id="db_printlog">
|
---|
| 312 | <term><command>db_printlog</command></term>
|
---|
| 313 | <listitem>
|
---|
| 314 | <para>converts database log files to human readable text.</para>
|
---|
| 315 | <indexterm zone="db db_printlog">
|
---|
| 316 | <primary sortas="b-db_printlog">db_printlog</primary>
|
---|
| 317 | </indexterm>
|
---|
| 318 | </listitem>
|
---|
| 319 | </varlistentry>
|
---|
| 320 |
|
---|
| 321 | <varlistentry id="db_recover">
|
---|
| 322 | <term><command>db_recover</command></term>
|
---|
| 323 | <listitem>
|
---|
| 324 | <para>is used to restore a database to a consistent state after a
|
---|
| 325 | failure.</para>
|
---|
| 326 | <indexterm zone="db db_recover">
|
---|
| 327 | <primary sortas="b-db_recover">db_recover</primary>
|
---|
| 328 | </indexterm>
|
---|
| 329 | </listitem>
|
---|
| 330 | </varlistentry>
|
---|
| 331 |
|
---|
| 332 | <varlistentry id="db_stat">
|
---|
| 333 | <term><command>db_stat</command></term>
|
---|
| 334 | <listitem>
|
---|
| 335 | <para>displays database environment statistics.</para>
|
---|
| 336 | <indexterm zone="db db_stat">
|
---|
| 337 | <primary sortas="b-db_stat">db_stat</primary>
|
---|
| 338 | </indexterm>
|
---|
| 339 | </listitem>
|
---|
| 340 | </varlistentry>
|
---|
| 341 |
|
---|
| 342 | <varlistentry id="db_upgrade">
|
---|
| 343 | <term><command>db_upgrade</command></term>
|
---|
| 344 | <listitem>
|
---|
| 345 | <para>is used to upgrade database files to a newer version of
|
---|
| 346 | <application>Berkeley DB</application>.</para>
|
---|
| 347 | <indexterm zone="db db_upgrade">
|
---|
| 348 | <primary sortas="b-db_upgrade">db_upgrade</primary>
|
---|
| 349 | </indexterm>
|
---|
| 350 | </listitem>
|
---|
| 351 | </varlistentry>
|
---|
| 352 |
|
---|
| 353 | <varlistentry id="db_verify">
|
---|
| 354 | <term><command>db_verify</command></term>
|
---|
| 355 | <listitem>
|
---|
| 356 | <para>is used to run consistency checks on database files.</para>
|
---|
| 357 | <indexterm zone="db db_verify">
|
---|
| 358 | <primary sortas="b-db_verify">db_verify</primary>
|
---|
| 359 | </indexterm>
|
---|
| 360 | </listitem>
|
---|
| 361 | </varlistentry>
|
---|
| 362 |
|
---|
[2a038b2] | 363 | -->
|
---|
| 364 |
|
---|
[b742c85] | 365 | </variablelist>
|
---|
| 366 |
|
---|
| 367 | </sect2>
|
---|
[f45b1953] | 368 |
|
---|
| 369 | </sect1>
|
---|