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