~ubuntu-branches/ubuntu/maverick/evolution-data-server/maverick-proposed

« back to all changes in this revision

Viewing changes to libdb/docs/api_tcl/env_open.html

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-05-17 17:02:06 UTC
  • mfrom: (1.1.79 upstream) (1.6.12 experimental)
  • Revision ID: james.westby@ubuntu.com-20100517170206-4ufr52vwrhh26yh0
Tags: 2.30.1-1ubuntu1
* Merge from debian experimental. Remaining change:
  (LP: #42199, #229669, #173703, #360344, #508494)
  + debian/control:
    - add Vcs-Bzr tag
    - don't use libgnome
    - Use Breaks instead of Conflicts against evolution 2.25 and earlier.
  + debian/evolution-data-server.install,
    debian/patches/45_libcamel_providers_version.patch:
    - use the upstream versioning, not a Debian-specific one 
  + debian/libedata-book1.2-dev.install, debian/libebackend-1.2-dev.install,
    debian/libcamel1.2-dev.install, debian/libedataserverui1.2-dev.install:
    - install html documentation
  + debian/rules:
    - don't build documentation it's shipped with the tarball

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<!--$Id$-->
2
 
<!--$Id$-->
3
 
<!--Copyright 1997-2002 by Sleepycat Software, Inc.-->
4
 
<!--All rights reserved.-->
5
 
<!--See the file LICENSE for redistribution information.-->
6
 
<html>
7
 
<head>
8
 
<title>Berkeley DB: berkdb env</title>
9
 
<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit.">
10
 
<meta name="keywords" content="embedded,database,programmatic,toolkit,b+tree,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,java,C,C++">
11
 
</head>
12
 
<body bgcolor=white>
13
 
<a name="2"><!--meow--></a>
14
 
<table width="100%"><tr valign=top>
15
 
<td>
16
 
<h1><b>berkdb env</b></h1>
17
 
</td>
18
 
<td align=right>
19
 
<a href="../api_tcl/tcl_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
20
 
</td></tr></table>
21
 
<hr size=1 noshade>
22
 
<tt>
23
 
<h3><pre>berkdb env
24
 
        [-cachesize {gbytes bytes ncache}]
25
 
        [-create]
26
 
        [-data_dir dirname]
27
 
        [-errfile filename]
28
 
        [-home directory]
29
 
        [-log_dir dirname]
30
 
        [-mode mode]
31
 
        [-private]
32
 
        [-recover]
33
 
        [-recover_fatal]
34
 
        [-shm_key shmid]
35
 
        [-system_mem]
36
 
        [-tmp_dir dirname]
37
 
        [-txn [nosync]]
38
 
        [-txn_max max]
39
 
        [-use_environ]
40
 
        [-use_environ_root]
41
 
</pre></h3>
42
 
<h1>Description</h1>
43
 
<p>The <b>berkdb env</b> command opens and optionally creates a database
44
 
environment.  The returned environment handle is bound to a Tcl command
45
 
of the form <b>envN</b>, where N is an integer starting at 0 (for
46
 
example, env0 and env1).  It is through this Tcl command that the script
47
 
accesses the environment methods.  The command automatically initializes
48
 
the Shared Memory Buffer Pool subsystem.  This subsystem is used
49
 
whenever the application is using any Berkeley DB access method.
50
 
<p>The options are as follows:
51
 
<p><dl compact>
52
 
<p><dt>-cachesize {gbytes bytes ncache}<dd>Set the size of the database's shared memory buffer pool (that is, the
53
 
cache), to <b>gbytes</b> gigabytes plus <b>bytes</b>.  The cache
54
 
should be the size of the normal working data set of the application,
55
 
with some small amount of additional memory for unusual situations.
56
 
(Note: The working set is not the same as the number of simultaneously
57
 
referenced pages, and should be quite a bit larger!)
58
 
<p>The default cache size is 256KB, and may not be specified as less than
59
 
20KB.  Any cache size less than 500MB is automatically increased by 25%
60
 
to account for buffer pool overhead; cache sizes larger than 500MB are
61
 
used as specified.
62
 
<p>It is possible to specify caches to Berkeley DB that are large enough so that
63
 
they cannot be allocated contiguously on some architectures; for example,
64
 
some releases of Solaris limit the amount of memory that may be
65
 
allocated contiguously by a process.  If <b>ncache</b> is 0 or 1, the
66
 
cache will be allocated contiguously in memory.  If it is greater than
67
 
1, the cache will be broken up into <b>ncache</b> equally sized
68
 
separate pieces of memory.
69
 
<p>For information on tuning the Berkeley DB cache size, see
70
 
<a href="../ref/am_conf/cachesize.html">Selecting a cache size</a>.
71
 
<p><dt>-create<dd>Cause Berkeley DB subsystems to create any underlying files, as necessary.
72
 
<p><dt>-data_dir dirname<dd>Specify the environment's data directory as described in
73
 
<a href="../ref/env/naming.html">Berkeley DB File Naming</a>.
74
 
<p><dt>-errfile filename<dd>
75
 
<p>When an error occurs in the Berkeley DB library, a Berkeley DB error or an error
76
 
return value is returned by the function. In some cases, however, the
77
 
errno value may be insufficient to completely describe the cause of the
78
 
error especially during initial application debugging.
79
 
<p>The <b>-errfile</b> argument is used to enhance the mechanism for
80
 
reporting error messages to the application by specifying a file to be
81
 
used for displaying additional Berkeley DB error messages. In some cases, when
82
 
an error occurs, Berkeley DB will output an additional error message to the
83
 
specified file reference.
84
 
<p>consist of the environment command name (for example, env0) and a colon
85
 
(":"), an error string, and a trailing &lt;newline&gt;
86
 
character.
87
 
<p>This error-logging enhancement does not slow performance or significantly
88
 
increase application size, and may be run during normal operation as well
89
 
as during application debugging.
90
 
<p><dt>-home directory<dd>The <b>-home</b> argument is described in
91
 
<a href="../ref/env/naming.html">Berkeley DB File Naming</a>.
92
 
<p><dt>-log_dir dirname<dd>Specify the environment's logging file directory as described in
93
 
<a href="../ref/env/naming.html">Berkeley DB File Naming</a>.
94
 
<p><dt>-mode mode<dd>
95
 
<p>On UNIX systems, or in IEEE/ANSI Std 1003.1 (POSIX) environments, all files created by Berkeley DB
96
 
are created with mode <b>mode</b> (as described in <b>chmod</b>(2)) and
97
 
modified by the process' umask value at the time of creation (see
98
 
<b>umask</b>(2)).  The group ownership of created files is based on
99
 
the system and directory defaults, and is not further specified by Berkeley DB.
100
 
If <b>mode</b> is 0, files are created readable and writable by both
101
 
owner and group.  On Windows systems, the mode argument is ignored.
102
 
<p><dt>-private<dd>Specify that the environment will only be accessed by a single process
103
 
(although that process may be multithreaded).  This flag has two effects
104
 
on the Berkeley DB environment.  First, all underlying data structures are
105
 
allocated from per-process memory instead of from shared memory that is
106
 
potentially accessible to more than a single process.  Second, mutexes
107
 
are only configured to work between threads.
108
 
<p>This flag should not be specified if more than a single process is
109
 
accessing the environment, as it is likely to cause database corruption
110
 
and unpredictable behavior.  For example, if both a server application
111
 
and the Berkeley DB utility <a href="../utility/db_stat.html">db_stat</a> will access the environment, the
112
 
<b>-private</b> option should not be specified.
113
 
<p><dt>-recover<dd>Run normal recovery on this environment before opening it for normal use.
114
 
If this flag is set, the <b>-create</b> option must also be set because
115
 
the regions will be removed and re-created.
116
 
<p><dt>-recover_fatal<dd>Run catastrophic recovery on this environment before opening it for
117
 
normal use.  If this flag is set, the <b>-create</b> option must also be
118
 
set since the regions will be removed and re-created.
119
 
<p><dt>-shm_key key<dd>Specify a base segment ID for Berkeley DB environment shared memory regions
120
 
created in system memory on systems supporting X/Open-style shared
121
 
memory interfaces, for example, UNIX systems supporting shmget(2) and
122
 
related System V IPC interfaces.  See <a href="../ref/env/region.html">Shared Memory Regions</a> for more information.
123
 
<p><dt>-system_mem<dd>Allocate memory from system shared memory instead of memory backed by the
124
 
filesystem.  See <a href="../ref/env/region.html">Shared Memory Regions</a>
125
 
for more information.
126
 
<p><dt>-tmp_dir dirname<dd>Specify the environment's tmp directory, as described in
127
 
<a href="../ref/env/naming.html">Berkeley DB File Naming</a>.
128
 
<p><dt>-txn [nosync]<dd>Initialize the Transaction subsystem.  This subsystem is used when
129
 
recovery and atomicity of multiple operations and recovery are important.
130
 
The <b>-txn</b> option implies the initialization of the logging
131
 
and locking subsystems as well.
132
 
<p>If the optional <b>nosync</b> argument is specified, the log will not be
133
 
synchronously flushed on transaction commit or prepare.  This means that
134
 
transactions exhibit the ACI (atomicity, consistency, and isolation)
135
 
properties, but not D (durability); that is, database integrity will be
136
 
maintained, but it is possible that some number of the most recently
137
 
committed transactions may be undone during recovery instead of being
138
 
redone.
139
 
<p>The number of transactions that are potentially at risk is governed by
140
 
how often the log is checkpointed (see <a href="../utility/db_checkpoint.html">db_checkpoint</a> for more
141
 
information) and how many log updates can fit on a single log page.
142
 
<p><dt>-txn_max max<dd>Set the maximum number of simultaneous transactions that are supported
143
 
by the environment, which bounds the size of backing files.  When there
144
 
are more than the specified number of concurrent transactions, calls to
145
 
<i>env</i> <b>txn</b> will fail (until some active transactions complete).
146
 
<p><dt>-use_environ<dd>The Berkeley DB process' environment may be permitted to specify information
147
 
to be used when naming files; see
148
 
<a href="../ref/env/naming.html">Berkeley DB File Naming</a>.
149
 
Because permitting users to specify which files are used can create
150
 
security problems, environment information will be used in file naming
151
 
for all users only if the <b>-use_environ</b> flag is set.
152
 
<p><dt>-use_environ_root<dd>The Berkeley DB process' environment may be permitted to specify information
153
 
to be used when naming files; see
154
 
<a href="../ref/env/naming.html">Berkeley DB File Naming</a>.
155
 
As permitting users to specify which files are used can create security
156
 
problems, if the <b>-use_environ_root</b> flag is set, environment
157
 
information will be used for file naming only for users with appropriate
158
 
permissions (for example, users with a user-ID of 0 on IEEE/ANSI Std 1003.1 (POSIX)
159
 
systems).
160
 
</dl>
161
 
<p>The <b>berkdb env</b> command returns an environment handle on success.
162
 
<p>In the case of error, a Tcl error is thrown.
163
 
</tt>
164
 
<table width="100%"><tr><td><br></td><td align=right>
165
 
<a href="../api_tcl/tcl_index.html"><img src="../images/api.gif" alt="API"></a><a href="../reftoc.html"><img src="../images/ref.gif" alt="Ref"></a>
166
 
</td></tr></table>
167
 
<p><font size=1><a href="http://www.sleepycat.com">Copyright Sleepycat Software</a></font>
168
 
</body>
169
 
</html>