Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > main-release > by-pkgid > a00abf5f94bf470fd4cc9e10b2d135e0 > files > 1092

lib64db4.8-devel-4.8.26-1mdv2010.1.x86_64.rpm

<?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>berkdb env</title>
    <link rel="stylesheet" href="apiReference.css" type="text/css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" />
    <link rel="start" href="index.html" title="Berkeley DB TCL API Reference" />
    <link rel="up" href="tclapi.html" title="Chapter 1.  Berkeley DB Tcl APIs" />
    <link rel="prev" href="env_dbrename.html" title="env dbrename" />
    <link rel="next" href="env_remove.html" title="berkdb envremove" />
  </head>
  <body>
    <div class="navheader">
      <table width="100%" summary="Navigation header">
        <tr>
          <th colspan="3" align="center">berkdb env</th>
        </tr>
        <tr>
          <td width="20%" align="left"><a accesskey="p" href="env_dbrename.html">Prev</a> </td>
          <th width="60%" align="center">Chapter 1. 
                Berkeley DB Tcl APIs
        </th>
          <td width="20%" align="right"> <a accesskey="n" href="env_remove.html">Next</a></td>
        </tr>
      </table>
      <hr />
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <div class="titlepage">
        <div>
          <div>
            <h2 class="title" style="clear: both"><a id="env_open"></a>berkdb env</h2>
          </div>
        </div>
      </div>
      <pre class="programlisting">berkdb env
	[-cachesize {gbytes bytes ncache}]
	[-create]
	[-data_dir dirname]
	[-encryptaes passwd]
	[-encryptany passwd]
	[-errfile filename]
	[-home directory]
	[-log_dir dirname]
	[-mode mode]
	[-private]
	[-recover]
	[-recover_fatal]
	[-shm_key shmid]
	[-system_mem]
	[-tmp_dir dirname]
	[-txn [nosync]]
	[-txn_max max]
	[-use_environ]
	[-use_environ_root]  </pre>
      <p>
         The <span class="bold"><strong>berkdb env</strong></span> command opens and
         optionally creates a database environment.  The returned environment
         handle is bound to a Tcl command of the form <span class="bold"><strong>envN</strong></span>, where N is an integer starting at 0 (for
         example, env0 and env1).  It is through this Tcl command that the
         script accesses the environment methods.  The command automatically
         initializes the Shared Memory Buffer Pool subsystem.  This subsystem
         is used whenever the application is using any Berkeley DB access
         method.
    </p>
      <p>
        The options are as follows:
    </p>
      <div class="itemizedlist">
        <ul type="disc">
          <li>
            <p>
                 <span class="bold"><strong>-cachesize {gbytes bytes ncache}</strong></span> 
            </p>
            <p>
                 Set the size of the database's shared memory buffer pool (that is, the
                 cache), to <span class="bold"><strong>gbytes</strong></span> gigabytes plus
                 <span class="bold"><strong>bytes</strong></span>.  The cache should be the size
                 of the normal working data set of the application, with some small
                 amount of additional memory for unusual situations. (Note: The working
                 set is not the same as the number of simultaneously referenced pages,
                 and should be quite a bit larger!)     
             </p>
            <p>
                 The default cache size is 256KB, and may not be specified as less than
                 20KB.  Any cache size less than 500MB is automatically increased by
                 25% to account for buffer pool overhead; cache sizes larger than 500MB
                 are used as specified.
            </p>
            <p>
                 It is possible to specify caches to Berkeley DB that are large enough
                 so that they cannot be allocated contiguously on some architectures;
                 for example, some releases of Solaris limit the amount of memory that
                 may be allocated contiguously by a process.  If <span class="bold"><strong>ncache</strong></span> is 0 or 1, the cache will be allocated
                 contiguously in memory.  If it is greater than 1, the cache will be
                 broken up into <span class="bold"><strong>ncache</strong></span> equally sized
                 separate pieces of memory.
            </p>
            <p>
                 For information on tuning the Berkeley DB cache size, see 
                 <a href="../../programmer_reference/general_am_conf.html#am_conf_cachesize" class="olink">Selecting a Cache Size</a>
                 in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em>.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-create</strong></span> 
            </p>
            <p>
                 Cause Berkeley DB subsystems to create any underlying files, as
                 necessary.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-data_dir dirname</strong></span> 
            </p>
            <p>
                 Specify the environment's data directory as described in 
                 <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a>
                 in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em>.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-encryptaes passwd</strong></span> 
            </p>
            <p>
                 Specify the database should be encrypted with the given password using
                 the Rijndael/AES (also known as the Advanced Encryption Standard and
                 Federal Information Processing Standard (FIPS) 197) algorithm.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-encryptany passwd</strong></span> 
            </p>
            <p>
                 Specify the already existing environment should be opened with the
                 given password.  This option is used if the environment is known to be
                 encrypted, but the specific algorithm used is not known.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-errfile filename</strong></span> 
            </p>
            <p>
                 When an error occurs in the Berkeley DB library, a Berkeley DB error
                 or an error return value is returned by the function. In some cases,
                 however, the errno value may be insufficient to completely describe
                 the cause of the error especially during initial application
                 debugging.
            </p>
            <p>
                 The <span class="bold"><strong>-errfile</strong></span> argument is used to
                 enhance the mechanism for reporting error messages to the application
                 by specifying a file to be used for displaying additional Berkeley DB
                 error messages. In some cases, when an error occurs, Berkeley DB will
                 output an additional error message to the specified file reference.
            </p>
            <p>
                 consist of the environment command name (for example, env0) and a
                 colon (":"), an error string, and a trailing &lt;newline&gt;
                 character.
            </p>
            <p>
                 This error-logging enhancement does not slow performance or
                 significantly increase application size, and may be run during normal
                 operation as well as during application debugging.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-home directory</strong></span> 
            </p>
            <p>
                 The <span class="bold"><strong>-home</strong></span> argument is described in
                 <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a>
                 in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em>.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-log_dir dirname</strong></span> 
            </p>
            <p>
                 Specify the environment's logging file directory as described in
                 <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a>
                 in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em>.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-mode mode</strong></span> 
            </p>
            <p>
                 On UNIX systems, or in IEEE/ANSI Std 1003.1 (POSIX) environments, all
                 files created by Berkeley DB are created with mode <span class="bold"><strong>mode</strong></span> (as described in <span class="bold"><strong>chmod</strong></span>(2)) and modified by the process' umask
                 value at the time of creation (see <span class="bold"><strong>umask</strong></span>(2)).  The group ownership of created
                 files is based on the system and directory defaults, and is not
                 further specified by Berkeley DB. If <span class="bold"><strong>mode</strong></span> is 0, files are created readable and
                 writable by both owner and group.  On Windows systems, the mode
                 argument is ignored.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-private</strong></span> 
            </p>
            <p>
                 Specify that the environment will only be accessed by a single process
                 (although that process may be multithreaded).  This flag has two
                 effects on the Berkeley DB environment.  First, all underlying data
                 structures are allocated from per-process memory instead of from
                 shared memory that is potentially accessible to more than a single
                 process.  Second, mutexes are only configured to work between threads.
             </p>
            <p>
                 This flag should not be specified if more than a single process is
                 accessing the environment, as it is likely to cause database
                 corruption and unpredictable behavior.  For example, if both a server
                 application and the Berkeley DB utility 
                 <a href="../C/db_stat.html" class="olink">db_stat</a>
                 will access the environment, the <span class="bold"><strong>-private</strong></span> option
                 should not be specified.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-recover</strong></span> 
            </p>
            <p>
                 Run normal recovery on this environment before opening it for normal
                 use. If this flag is set, the <span class="bold"><strong>-create</strong></span>
                 option must also be set because the regions will be removed and
                 re-created.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-recover_fatal</strong></span> 
            </p>
            <p>
                 Run catastrophic recovery on this environment before opening it for
                 normal use.  If this flag is set, the <span class="bold"><strong>-create</strong></span> option must also be set since the
                 regions will be removed and re-created.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-shm_key key</strong></span> 
            </p>
            <p>
                 Specify a base segment ID for Berkeley DB environment shared memory
                 regions created in system memory on systems supporting X/Open-style
                 shared memory interfaces, for example, UNIX systems supporting
                 shmget(2) and related System V IPC interfaces.  See 
                 <a href="../../programmer_reference/env_region.html" class="olink">Shared Memory Regions</a>
                 in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em> for more information.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-system_mem</strong></span> 
            </p>
            <p>
                 Allocate memory from system shared memory instead of memory backed by
                 the filesystem.  See 
                 <a href="../../programmer_reference/env_region.html" class="olink">Shared Memory Regions</a>
                 in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em> for more information.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-tmp_dir dirname</strong></span> 
            </p>
            <p>
                 Specify the environment's tmp directory, as described in 
                 <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a>
                 in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em>.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-txn [nosync]</strong></span> 
            </p>
            <p>
                 Initialize the Transaction subsystem.  This subsystem is used when
                 recovery and atomicity of multiple operations and recovery are
                 important. The <span class="bold"><strong>-txn</strong></span> option implies
                 the initialization of the logging and locking subsystems as well.    
             </p>
            <p>
                 If the optional <span class="bold"><strong>nosync</strong></span> argument is
                 specified, the log will not be synchronously flushed on transaction
                 commit.  This means that transactions exhibit the ACI (atomicity,
                 consistency, and isolation) properties, but not D (durability); that
                 is, database integrity will be maintained, but it is possible that
                 some number of the most recently committed transactions may be undone
                 during recovery instead of being redone.
            </p>
            <p>
                 The number of transactions that are potentially at risk is governed by
                 how often the log is checkpointed (see 
                 <a href="../C/db_checkpoint.html" class="olink">db_checkpoint</a>
                 in the <em class="citetitle">Berkeley DB C API</em> guide for more information) and how many 
                 log updates can fit on a single log page.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-txn_max max</strong></span> 
            </p>
            <p>
                 Set the maximum number of simultaneous transactions that are supported
                 by the environment, which bounds the size of backing files.  When
                 there are more than the specified number of concurrent transactions,
                 calls to <span class="emphasis"><em>env</em></span> <span class="bold"><strong>txn</strong></span>
                 will fail (until some active transactions complete).
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-use_environ</strong></span> 
            </p>
            <p>
                 The Berkeley DB process' environment may be permitted to specify
                 information to be used when naming files; see 
                 <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a>
                 in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em>.  Because
                 permitting users to specify which files are used can create security
                 problems, environment information will be used in file naming for all
                 users only if the <span class="bold"><strong>-use_environ</strong></span> flag
                 is set.
            </p>
          </li>
          <li>
            <p>
                  <span class="bold"><strong>-use_environ_root</strong></span> 
            </p>
            <p>
                 The Berkeley DB process' environment may be permitted to specify
                 information to be used when naming files; see 
                 <a href="../../programmer_reference/env_naming.html" class="olink">Berkeley DB File Naming</a>
                 in the <em class="citetitle">Berkeley DB Programmer's Reference Guide</em>.  As
                 permitting users to specify which files are used can create security
                 problems, if the <span class="bold"><strong>-use_environ_root</strong></span>
                 flag is set, environment information will be used for file naming only
                 for users with appropriate permissions (for example, users with a
                 user-ID of 0 on IEEE/ANSI Std 1003.1 (POSIX) systems).
            </p>
          </li>
        </ul>
      </div>
      <p>
         The <span class="bold"><strong>berkdb env</strong></span> command returns an
         environment handle on success.
    </p>
      <p>
        In the case of error, a Tcl error is thrown.
    </p>
    </div>
    <div class="navfooter">
      <hr />
      <table width="100%" summary="Navigation footer">
        <tr>
          <td width="40%" align="left"><a accesskey="p" href="env_dbrename.html">Prev</a> </td>
          <td width="20%" align="center">
            <a accesskey="u" href="tclapi.html">Up</a>
          </td>
          <td width="40%" align="right"> <a accesskey="n" href="env_remove.html">Next</a></td>
        </tr>
        <tr>
          <td width="40%" align="left" valign="top"><span class="emphasis"><em>env</em></span> dbrename </td>
          <td width="20%" align="center">
            <a accesskey="h" href="index.html">Home</a>
          </td>
          <td width="40%" align="right" valign="top"> berkdb envremove</td>
        </tr>
      </table>
    </div>
  </body>
</html>