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 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Chapter 3. Configuring the Berkeley DB SQL interface</title>
<link rel="stylesheet" href="gettingStarted.css" type="text/css" />
<meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
<link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" />
<link rel="up" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" />
<link rel="prev" href="lockhandling.html" title="Lock Handling" />
<link rel="next" href="using_dbconfig.html" title="The DB_CONFIG File" />
</head>
<body>
<div class="navheader">
<table width="100%" summary="Navigation header">
<tr>
<th colspan="3" align="center">Chapter 3. Configuring the Berkeley DB SQL interface</th>
</tr>
<tr>
<td width="20%" align="left"><a accesskey="p" href="lockhandling.html">Prev</a> </td>
<th width="60%" align="center"> </th>
<td width="20%" align="right"> <a accesskey="n" href="using_dbconfig.html">Next</a></td>
</tr>
</table>
<hr />
</div>
<div class="chapter" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title"><a id="configure"></a>Chapter 3. Configuring the Berkeley DB SQL interface</h2>
</div>
</div>
</div>
<div class="toc">
<p>
<b>Table of Contents</b>
</p>
<dl>
<dt>
<span class="sect1">
<a href="configure.html#env-overview">Introduction to Environments</a>
</span>
</dt>
<dt>
<span class="sect1">
<a href="using_dbconfig.html">The DB_CONFIG File</a>
</span>
</dt>
<dd>
<dl>
<dt>
<span class="sect2">
<a href="using_dbconfig.html#dbconfigcreate">Creating the DB_CONFIG File Before Environment Creation</a>
</span>
</dt>
<dt>
<span class="sect2">
<a href="using_dbconfig.html#envrecreate">Re-creating the Environment</a>
</span>
</dt>
</dl>
</dd>
<dt>
<span class="sect1">
<a href="configpage.html">Configuring the Database Page Size</a>
</span>
</dt>
<dd>
<dl>
<dt>
<span class="sect2">
<a href="configpage.html#selectpage_size">Selecting the Page Size</a>
</span>
</dt>
</dl>
</dd>
<dt>
<span class="sect1">
<a href="dbfilesize.html">Selecting the Database File Size</a>
</span>
</dt>
<dt>
<span class="sect1">
<a href="configcache.html">Configuring the In-Memory Cache</a>
</span>
</dt>
<dt>
<span class="sect1">
<a href="admin-logfile.html">Administering Log Files</a>
</span>
</dt>
<dd>
<dl>
<dt>
<span class="sect2">
<a href="admin-logfile.html#logfilesize">Setting the Log File Size</a>
</span>
</dt>
<dt>
<span class="sect2">
<a href="admin-logfile.html#logregionsize">Configuring the Logging Region Size</a>
</span>
</dt>
<dt>
<span class="sect2">
<a href="admin-logfile.html#logbuffer">Setting the In-Memory Log Buffer Size</a>
</span>
</dt>
</dl>
</dd>
<dt>
<span class="sect1">
<a href="admin-locking.html">Managing the Locking Subsystem</a>
</span>
</dt>
</dl>
</div>
<p>
In almost all cases, there is no need for you to directly
configure Berkeley DB resources; instead, you can use the
same configuration techniques that you always use for SQLite.
The Berkeley DB SQL interface will take care of the rest.
</p>
<p>
However, there are a few configuration activities that some
unusually large or busy installations might need to make and for
which there is no SQLite equivalent. This chapter describes
those activities.
</p>
<div class="sect1" lang="en" xml:lang="en">
<div class="titlepage">
<div>
<div>
<h2 class="title" style="clear: both"><a id="env-overview"></a>Introduction to Environments</h2>
</div>
</div>
</div>
<p>
Before continuing with this section, it is necessary
for you to have a high-level understanding of Berkeley DB's
environments.
</p>
<p>
In order to manage its resources (data, shared cache, locks,
and transaction logs), Berkeley DB often uses a directory
that is called the <span class="emphasis"><em>Berkeley DB environment</em></span>.
As used with the BDB SQL interface, environments contain log files and the
information required to implement a shared cache and
fine-grained locking. This environment is placed in a
directory that appears on the surface to be a SQLite
rollback file.
</p>
<p>
That is, if you use BDB SQL interface to create a database called
<code class="literal">mydb.db</code>, then a directory is created
alongside of it called <code class="literal">mydb.db-journal</code>.
Normally, SQLite creates a journal file only when a
transaction is underway, and deletes this file once the
transaction is committed or rolled back. However, that is not
what is happening here. The BDB SQL interface journal directory contains
important Berkeley DB environment information that is meant to
persist between transactions and even between process
runtimes. So it is very important that you do
<span class="emphasis"><em>not</em></span> delete the contents of your Berkeley DB
journal directory. Doing so will cause improper operation and
could lead to data loss.
</p>
<p>
Note that the environment directory is also where you put
your <code class="literal">DB_CONFIG</code> file. This file can be used to
configure additional tuning parameters of Berkeley DB, if its
default behavior is not appropriate for your
application. For more information
on the <code class="literal">DB_CONFIG</code> file, see
the next section.
</p>
<div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
<h3 class="title">Note</h3>
<p>
Experienced users of Berkeley DB should be aware
that neither <code class="literal">DB_USE_ENVIRON</code> nor
<code class="literal">DB_USE_ENVIRON_ROOT</code> are
specified to
<code class="methodname">DB_ENV->open()</code>. As
a result, the <code class="literal">DB_HOME</code>
environment variable is ignored. This means that the
BDB SQL interface will always create a database
in the location defined by the database name given to
the BDB SQL interface.
</p>
</div>
</div>
</div>
<div class="navfooter">
<hr />
<table width="100%" summary="Navigation footer">
<tr>
<td width="40%" align="left"><a accesskey="p" href="lockhandling.html">Prev</a> </td>
<td width="20%" align="center"> </td>
<td width="40%" align="right"> <a accesskey="n" href="using_dbconfig.html">Next</a></td>
</tr>
<tr>
<td width="40%" align="left" valign="top">Lock Handling </td>
<td width="20%" align="center">
<a accesskey="h" href="index.html">Home</a>
</td>
<td width="40%" align="right" valign="top"> The DB_CONFIG File</td>
</tr>
</table>
</div>
</body>
</html>
|