diff options
Diffstat (limited to 'db/docs/ref/program')
-rw-r--r-- | db/docs/ref/program/appsignals.html | 4 | ||||
-rw-r--r-- | db/docs/ref/program/cache.html | 4 | ||||
-rw-r--r-- | db/docs/ref/program/compatible.html | 4 | ||||
-rw-r--r-- | db/docs/ref/program/copy.html | 101 | ||||
-rw-r--r-- | db/docs/ref/program/environ.html | 4 | ||||
-rw-r--r-- | db/docs/ref/program/errorret.html | 29 | ||||
-rw-r--r-- | db/docs/ref/program/faq.html | 4 | ||||
-rw-r--r-- | db/docs/ref/program/mt.html | 8 | ||||
-rw-r--r-- | db/docs/ref/program/namespace.html | 4 | ||||
-rw-r--r-- | db/docs/ref/program/ram.html | 141 | ||||
-rw-r--r-- | db/docs/ref/program/runtime.html | 20 | ||||
-rw-r--r-- | db/docs/ref/program/scope.html | 4 |
12 files changed, 201 insertions, 126 deletions
diff --git a/db/docs/ref/program/appsignals.html b/db/docs/ref/program/appsignals.html index 378af10c0..19cbff612 100644 --- a/db/docs/ref/program/appsignals.html +++ b/db/docs/ref/program/appsignals.html @@ -1,5 +1,5 @@ <!--$Id: appsignals.so,v 10.28 2002/02/23 20:05:24 bostic Exp $--> -<!--Copyright 1997-2004 by Sleepycat Software, Inc.--> +<!--Copyright 1997-2006 by Oracle Corporation--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> @@ -34,6 +34,6 @@ underlying system calls that return failure with errno set to EINTR will be restarted rather than failing.</p> <table width="100%"><tr><td><br></td><td align=right><a href="../apprec/config.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/errorret.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> -<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> +<p><font size=1>Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.</font> </body> </html> diff --git a/db/docs/ref/program/cache.html b/db/docs/ref/program/cache.html index fa7d7685f..ec53dbeb5 100644 --- a/db/docs/ref/program/cache.html +++ b/db/docs/ref/program/cache.html @@ -1,5 +1,5 @@ <!--$Id: cache.so,v 10.3 2002/09/26 01:38:32 bostic Exp $--> -<!--Copyright 1997-2004 by Sleepycat Software, Inc.--> +<!--Copyright 1997-2006 by Oracle Corporation--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> @@ -30,6 +30,6 @@ Many times, this means that write-caching on the disk drive must be disabled.</p> <table width="100%"><tr><td><br></td><td align=right><a href="../program/ram.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/copy.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> -<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> +<p><font size=1>Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.</font> </body> </html> diff --git a/db/docs/ref/program/compatible.html b/db/docs/ref/program/compatible.html index 9537853ce..13a8c695f 100644 --- a/db/docs/ref/program/compatible.html +++ b/db/docs/ref/program/compatible.html @@ -1,5 +1,5 @@ <!--$Id: compatible.so,v 10.34 2002/02/23 20:05:24 bostic Exp $--> -<!--Copyright 1997-2004 by Sleepycat Software, Inc.--> +<!--Copyright 1997-2006 by Oracle Corporation--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> @@ -28,6 +28,6 @@ information. No utilities are provided to convert UNIX <a href="../../api_c/dbm <a href="../../api_c/dbm.html">ndbm</a>, or <a href="../../api_c/hsearch.html">hsearch</a> databases.</p> <table width="100%"><tr><td><br></td><td align=right><a href="../program/copy.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/runtime.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> -<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> +<p><font size=1>Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.</font> </body> </html> diff --git a/db/docs/ref/program/copy.html b/db/docs/ref/program/copy.html index 4aee3846c..d423387e0 100644 --- a/db/docs/ref/program/copy.html +++ b/db/docs/ref/program/copy.html @@ -1,10 +1,10 @@ -<!--$Id: copy.so,v 10.13 2004/03/24 20:12:08 bostic Exp $--> -<!--Copyright 1997-2004 by Sleepycat Software, Inc.--> +<!--$Id: copy.so,v 10.17 2005/06/16 17:07:07 bostic Exp $--> +<!--Copyright 1997-2006 by Oracle Corporation--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> <head> -<title>Berkeley DB Reference Guide: Copying databases</title> +<title>Berkeley DB Reference Guide: Copying or moving databases</title> <meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> <meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> </head> @@ -14,51 +14,72 @@ <td align=right><a href="../program/cache.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/compatible.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> <p> -<h3 align=center>Copying databases</h3> -<p>Because file identification cookies (for example, filenames, device and -inode numbers, volume and file IDs, and so on) are not necessarily -unique or maintained across system reboots, each Berkeley DB database file -contains a 20-byte file identification bytestring that is stored in the -first page of the database, starting with the 53rd byte on the page. +<h3 align=center>Copying or moving databases</h3> +<a name="2"><!--meow--></a> +<a name="3"><!--meow--></a> +<p>There are two issues with copying or moving databases: database page log +sequence numbers (LSNs), and database file identification strings.</p> +<p>Because database pages contain references to the database environment +log records (LSNs), databases cannot be copied or moved from one +transactional database environment to another without first clearing the +LSNs. Note that this is not a concern for non-transactional database +environments and applications, and can be ignored if the database is not +being used transactionally. Specifically, databases created and written +non-transactionally (for example, as part of a bulk load procedure), can +be copied or moved into a transactional database environment without +resetting the LSNs. The database's LSNs may be reset in one of three +ways: the application can call the <a href="../../api_c/env_lsn_reset.html">DB_ENV->lsn_reset</a> method to reset the +LSNs in place, or a system administrator can reset the LSNs in place +using the <b>-r</b> option to the <a href="../../utility/db_load.html">db_load</a> utility, or by +dumping and reloading the database (using the <a href="../../utility/db_dump.html">db_dump</a> and +<a href="../../utility/db_load.html">db_load</a> utilities).</p> +<p>Because system file identification information (for example, filenames, +device and inode numbers, volume and file IDs, and so on) are not +necessarily unique or maintained across system reboots, each Berkeley DB +database file contains a unique 20-byte file identification bytestring. When multiple processes or threads open the same database file in Berkeley DB, -it is this bytestring that is used to ensure that the same underlying -pages are updated in the shared memory buffer pool, no matter which -Berkeley DB handle is used for the operation.</p> -<p>It is usually a bad idea to physically copy a database to a new name. -In the few cases in which copying is the best solution for your -application, you must guarantee that there are never two different -databases with the same file identification bytestring in the memory -pool at the same time. Copying databases is further complicated because -the shared memory buffer pool does not discard cached database pages -when the database is closed by calling the <a href="../../api_c/db_close.html">DB->close</a> method, cached -pages are only discarded when the database is removed by calling the -<a href="../../api_c/db_remove.html">DB->remove</a> method.</p> -<p>Before copying a database, you must ensure that all modified pages have -been written from the memory pool cache to the backing database file. -This is done using the <a href="../../api_c/db_sync.html">DB->sync</a> or <a href="../../api_c/db_close.html">DB->close</a> methods.</p> -<p>Before using a copy of a database from Berkeley DB, you must ensure that all -pages from any database with the same bytestring have been removed from -the memory pool cache. If the environment in which you intend to open -the copy of the database potentially has pages from files with identical -bytestrings to the copied database (which is likely to be the case), there -are a few possible solutions:</p> +it is this bytestring that is used to ensure the same underlying pages +are updated in the database environment cache, no matter which Berkeley DB +handle is used for the operation.</p> +<p>The database file identification string is not a concern when moving +databases, and databases may be moved or renamed without resetting the +identification string. However, when copying a database, you must +ensure there are never two databases with the same file identification +bytestring in the same cache at the same time. Copying databases is +further complicated because Berkeley DB caches do not discard cached database +pages when database handles are closed. Cached pages are only discarded +when the database is removed by calling the <a href="../../api_c/env_remove.html">DB_ENV->remove</a> or +<a href="../../api_c/db_remove.html">DB->remove</a> methods.</p> +<p>Before physically copying a database file, first ensure that all +modified pages have been written from the cache to the backing database +file. This is done using the <a href="../../api_c/db_sync.html">DB->sync</a> or <a href="../../api_c/db_close.html">DB->close</a> methods.</p> +<p>Before using a copy of a database file in a database environment, you +must ensure that all pages from any other database with the same +bytestring have been removed from the memory pool cache. If the +environment in which you will open the copy of the database has pages +from files with identical bytestrings to the copied database, there are +a few possible solutions:</p> <ol> -<p><li>Remove the environment, either explicitly or by calling <a href="../../api_c/env_remove.html">DB_ENV->remove</a>. -Note that this will not allow you to access both the original and copy -of the database at the same time. +<p><li>Remove the environment, either using system utilities or by calling the +<a href="../../api_c/env_remove.html">DB_ENV->remove</a> method. Obviously, this will not allow you to access +both the original database and the copy of the database at the same +time. <p><li>Create a new file that will have a new bytestring. The simplest way to create a new file that will have a new bytestring is to call the <a href="../../utility/db_dump.html">db_dump</a> utility to dump out the contents of the database and then use the <a href="../../utility/db_load.html">db_load</a> utility to load the dumped output into a -new file. This allows you to access both the original and copy of -the database at the same time. -<p><li>If your database is too large to be copied, reset the bytestring in the -copied database to a new bytestring. This allows you to access both the -original and copy of the database at the same time. You can reset the -bytestring with the <b>-r</b> flag to the <a href="../../utility/db_load.html">db_load</a> utility. +new file. This allows you to access both the original and copy of the +database at the same time. +<p><li>If your database is too large to be dumped and reloaded, you can copy +the database by other means, and then reset the bytestring in the copied +database to a new bytestring. There are two ways to reset the +bytestring in the copy: the application can call the +<a href="../../api_c/env_fileid_reset.html">DB_ENV->fileid_reset</a> method, or a system administrator can use the +<b>-r</b> option to the <a href="../../utility/db_load.html">db_load</a> utility. This allows you to +access both the original and copy of the database at the same time. </ol> <table width="100%"><tr><td><br></td><td align=right><a href="../program/cache.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/compatible.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> -<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> +<p><font size=1>Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.</font> </body> </html> diff --git a/db/docs/ref/program/environ.html b/db/docs/ref/program/environ.html index 73e7f3685..a51cb266a 100644 --- a/db/docs/ref/program/environ.html +++ b/db/docs/ref/program/environ.html @@ -1,5 +1,5 @@ <!--$Id: environ.so,v 10.21 2001/04/16 17:11:40 bostic Exp $--> -<!--Copyright 1997-2004 by Sleepycat Software, Inc.--> +<!--Copyright 1997-2006 by Oracle Corporation--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> @@ -29,6 +29,6 @@ checked as locations in which to create temporary files. See </dl> <table width="100%"><tr><td><br></td><td align=right><a href="../program/errorret.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/mt.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> -<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> +<p><font size=1>Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.</font> </body> </html> diff --git a/db/docs/ref/program/errorret.html b/db/docs/ref/program/errorret.html index 5189d2e5e..643eee09a 100644 --- a/db/docs/ref/program/errorret.html +++ b/db/docs/ref/program/errorret.html @@ -1,5 +1,5 @@ -<!--$Id: errorret.so,v 10.47 2004/10/14 13:32:14 bostic Exp $--> -<!--Copyright 1997-2004 by Sleepycat Software, Inc.--> +<!--$Id: errorret.so,v 10.49 2006/08/25 18:22:01 bostic Exp $--> +<!--Copyright 1997-2006 by Oracle Corporation--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> @@ -74,8 +74,10 @@ DB_LOCK_DEADLOCK. Whenever a Berkeley DB function returns DB_LOCK_DEADLOCK, the enclosing transaction should be aborted.</p> <p>Any Berkeley DB function that attempts to acquire locks can potentially return DB_LOCK_DEADLOCK. Practically speaking, the safest way to deal -with applications that can deadlock is to handle a -DB_LOCK_DEADLOCK return from any Berkeley DB access method call.</p> +with applications that can deadlock is to anticipate a +DB_LOCK_DEADLOCK return from any <a href="../../api_c/db_class.html">DB</a> or <a href="../../api_c/dbc_class.html">DBC</a> +handle method call, or any <a href="../../api_c/env_class.html">DB_ENV</a> handle method call that +references a database, including the database's backing physical file.</p> <h3><a name="DB_LOCK_NOTGRANTED">DB_LOCK_NOTGRANTED</a></h3> <p>If a lock is requested from the <a href="../../api_c/lock_get.html">DB_ENV->lock_get</a> or <a href="../../api_c/lock_vec.html">DB_ENV->lock_vec</a> methods with the <a href="../../api_c/lock_vec.html#DB_LOCK_NOWAIT">DB_LOCK_NOWAIT</a> flag specified, the method will return @@ -97,18 +99,15 @@ DB_RUNRECOVERY is returned. This error can be returned by any Berkeley DB interface. Once DB_RUNRECOVERY is returned by any interface, it will be returned from all subsequent Berkeley DB calls made by any threads of control participating in the environment.</p> -<p>Optionally, applications may also specify a fatal-error callback function -using the <a href="../../api_c/env_set_paniccall.html">DB_ENV->set_paniccall</a> method. This callback function will be -called with two arguments: a reference to the <a href="../../api_c/env_class.html">DB_ENV</a> structure -associated with the environment and the <b>errno</b> value -associated with the underlying error that caused the problem.</p> -<p>Applications can handle such fatal errors in one of two ways: by checking -for DB_RUNRECOVERY as part of their normal Berkeley DB error return -checking, similarly to DB_LOCK_DEADLOCK or any other error, or -by simply exiting the application when the callback function is called -in applications that have no cleanup processing of their own.</p> +<p>Applications can handle such fatal errors in one of two ways: first, by +checking for DB_RUNRECOVERY as part of their normal Berkeley DB error +return checking, similarly to DB_LOCK_DEADLOCK or any other +error. Alternatively, applications can specify a fatal-error callback +function using the <a href="../../api_c/env_event_notify.html">DB_ENV->set_event_notify</a> method. Applications with +no cleanup processing of their own should simply exit from the callback +function.</p> <table width="100%"><tr><td><br></td><td align=right><a href="../program/appsignals.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/environ.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> -<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> +<p><font size=1>Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.</font> </body> </html> diff --git a/db/docs/ref/program/faq.html b/db/docs/ref/program/faq.html index e58491447..566091467 100644 --- a/db/docs/ref/program/faq.html +++ b/db/docs/ref/program/faq.html @@ -1,5 +1,5 @@ <!--$Id: faq.so,v 10.3 2002/12/10 23:41:42 mjc Exp $--> -<!--Copyright 1997-2004 by Sleepycat Software, Inc.--> +<!--Copyright 1997-2006 by Oracle Corporation--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> @@ -38,6 +38,6 @@ contains the wrapper object.</p> </ol> <table width="100%"><tr><td><br></td><td align=right><a href="../program/runtime.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../lock/intro.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> -<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> +<p><font size=1>Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.</font> </body> </html> diff --git a/db/docs/ref/program/mt.html b/db/docs/ref/program/mt.html index 80321efc4..3dc6666a5 100644 --- a/db/docs/ref/program/mt.html +++ b/db/docs/ref/program/mt.html @@ -1,5 +1,5 @@ -<!--$Id: mt.so,v 10.47 2003/05/09 20:14:34 bostic Exp $--> -<!--Copyright 1997-2004 by Sleepycat Software, Inc.--> +<!--$Id: mt.so,v 10.48 2005/07/20 16:34:05 bostic Exp $--> +<!--Copyright 1997-2006 by Oracle Corporation--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> @@ -64,7 +64,7 @@ another thread.</p> <p>It is possible to specify a yield function on an per-application basis. See <a href="../../api_c/set_func_yield.html">db_env_set_func_yield</a> for more information.</p> <p>It is possible to specify the number of attempts that will be made to -acquire the mutex before waiting. See <a href="../../api_c/env_set_tas_spins.html">DB_ENV->set_tas_spins</a> for +acquire the mutex before waiting. See <a href="../../api_c/mutex_set_tas_spins.html">DB_ENV->mutex_set_tas_spins</a> for more information.</p> </ol> <p>When creating multiple databases in a single physical file, multithreaded @@ -73,6 +73,6 @@ programs may have additional requirements. For more information, see file.</a></p> <table width="100%"><tr><td><br></td><td align=right><a href="../program/environ.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/scope.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> -<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> +<p><font size=1>Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.</font> </body> </html> diff --git a/db/docs/ref/program/namespace.html b/db/docs/ref/program/namespace.html index b3b3db7ed..15ca32b88 100644 --- a/db/docs/ref/program/namespace.html +++ b/db/docs/ref/program/namespace.html @@ -1,5 +1,5 @@ <!--$Id: namespace.so,v 10.22 2004/03/08 15:09:20 bostic Exp $--> -<!--Copyright 1997-2004 by Sleepycat Software, Inc.--> +<!--Copyright 1997-2006 by Oracle Corporation--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> @@ -51,6 +51,6 @@ are the digits 0 through 9. Applications should never remove any files named with the prefix "__db" or "log", other than "__db.###" files.</p> <table width="100%"><tr><td><br></td><td align=right><a href="../program/scope.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/ram.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> -<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> +<p><font size=1>Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.</font> </body> </html> diff --git a/db/docs/ref/program/ram.html b/db/docs/ref/program/ram.html index d050577b3..787de5075 100644 --- a/db/docs/ref/program/ram.html +++ b/db/docs/ref/program/ram.html @@ -1,62 +1,117 @@ -<!--$Id: ram.so,v 10.6 2004/09/28 13:31:25 bostic Exp $--> -<!--Copyright 1997-2004 by Sleepycat Software, Inc.--> +<!--$Id: ram.so,v 10.10 2006/09/19 15:42:31 bostic Exp $--> +<!--Copyright 1997-2006 by Oracle Corporation--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> <head> -<title>Berkeley DB Reference Guide: Memory-only configurations</title> +<title>Berkeley DB Reference Guide: Memory-only or Flash configurations</title> <meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> <meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> </head> <body bgcolor=white> +<a name="2"><!--meow--></a> <table width="100%"><tr valign=top> <td><h3><dl><dt>Berkeley DB Reference Guide:<dd>Programmer Notes</dl></h3></td> <td align=right><a href="../program/namespace.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/cache.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> <p> -<h3 align=center>Memory-only configurations</h3> -<p>Berkeley DB supports a variety of memory-only configurations, intended for -systems where filesystem space is limited in availability or entirely -replaced by some combination of RAM and Flash. There are three database -environment files that are potentially written to disk: database -environment shared region files, database files and log files. Each of -these file types can be individually configured to be created in memory -rather than on disk.</p> -<p>First, database environment shared region files. Applications can -create RAM-only database environments in two different types of memory: -in application heap memory or in system shared memory. To create the -database environment in heap memory, specify the <a href="../../api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> flag -to the <a href="../../api_c/env_open.html">DB_ENV->open</a> method. Database environments created in heap -memory are only accessible to the threads of a single process, however. -To create the database environment in system shared memory, specify the +<h3 align=center>Memory-only or Flash configurations</h3> +<p>Berkeley DB supports a variety of memory-based configurations for systems +where filesystem space is either limited in availability or entirely +replaced by some combination of memory and Flash. In addition, Berkeley DB +can be configured to minimize writes to the filesystem when the +filesystem is backed by Flash memory.</p> +<p>There are three parts of the Berkeley DB database environment normally written +to the filesystem: the database environment region files, the database +files and the database environment log files. Each of these items can +be configured to live in memory rather than in the filesystem:</p> +<dl compact> +<dt>The database environment region files:<dd>Each of the Berkeley DB subsystems in a database environment is described by +one or more regions, or chunks of memory. The regions contain all of the +per-process and per-thread shared information (including mutexes), that +comprise a Berkeley DB environment. By default, these regions are backed by +the filesystem. In situations where filesystem backed regions aren't +optimal, applications can create memory-only database environments in +two different types of memory: either in the application's heap memory +or in system shared memory. +<p>To create the database environment in heap memory, specify the +<a href="../../api_c/env_open.html#DB_PRIVATE">DB_PRIVATE</a> flag to the <a href="../../api_c/env_open.html">DB_ENV->open</a> method. Note that database +environments created in heap memory are only accessible to the threads +of a single process, however.</p> +<p>To create the database environment in system shared memory, specify the <a href="../../api_c/env_open.html#DB_SYSTEM_MEM">DB_SYSTEM_MEM</a> flag to the <a href="../../api_c/env_open.html">DB_ENV->open</a> method. Database environments created in system memory are accessible to multiple -processes. However, database environments created in system shared -memory do create a small (roughly 8 byte) file in the file system read -by the processes to identify the system shared memory segments to use.</p> -<p>Second, database files. Applications can create RAM-only databases by -not specifying a physical filename when opening the database using the -<a href="../../api_c/db_open.html">DB->open</a> method. Normally, if the database environment cache fills -up Berkeley DB will create temporary backing files for RAM-only databases. -Use the <a href="../../api_c/memp_set_flags.html#DB_MPOOL_NOFILE">DB_MPOOL_NOFILE</a> flag to the <a href="../../api_c/memp_set_flags.html">DB_MPOOLFILE->set_flags</a> method to -configure the cache to never create backing files for a database. Use -the <a href="../../api_c/memp_set_maxsize.html">DB_MPOOLFILE->set_maxsize</a> method to limit the size of a database so it -cannot dirty the entire cache.</p> -<p>Third, log files. If a database environment is intended to be -transactionally recoverable after application or system failure (that -is, if it will exhibit the transactional attribute of "durability"), the -databases and the database environment log files must either be written -to the local disk and recovered, or they must be replicated to other -systems. When durability is not desired, or is accomplished through -replication, local database environments can be configured for -transactional behavior without durability, resulting in log files never -being written to disk. To configure a database environment this way, -specify the <a href="../../api_c/env_set_flags.html#DB_LOG_INMEMORY">DB_LOG_INMEMORY</a> flag to the -<a href="../../api_c/env_set_flags.html">DB_ENV->set_flags</a> method. To configure an individual database in a -database environment to be transactional but not durable, specify the -<a href="../../api_c/db_set_flags.html#DB_TXN_NOT_DURABLE">DB_TXN_NOT_DURABLE</a> flag to the <a href="../../api_c/db_set_flags.html">DB->set_flags</a> method.</p> +processes, but note that database environments created in system shared +memory do create a small (roughly 8 byte) file in the filesystem, read +by the processes to identify which system shared memory segments to +use.</p> +<p>For more information, see <a href="../../ref/env/region.html">Shared +memory regions</a>.</p> +<dt>The database files:<dd>By default, databases are periodically flushed from the Berkeley DB memory +cache to backing physical files in the filesystem. To keep databases +from being written to backing physical files, pass the +<a href="../../api_c/memp_set_flags.html#DB_MPOOL_NOFILE">DB_MPOOL_NOFILE</a> flag to the <a href="../../api_c/memp_set_flags.html">DB_MPOOLFILE->set_flags</a> method. This flag +implies the application's databases must fit entirely in the Berkeley DB +cache, of course. To avoid a database file growing to consume the +entire cache, applications can limit the size of individual databases +in the cache by calling the <a href="../../api_c/memp_set_maxsize.html">DB_MPOOLFILE->set_maxsize</a> method. +<dt>The database environment log files:<dd>If a database environment is not intended to be transactionally +recoverable after application or system failure (that is, if it will not +exhibit the transactional attribute of "durability"), applications +should not configure the database environment for logging or +transactions, in which case no log files will be created. If the +database environment is intended to be durable, log files must either +be written to stable storage and recovered after application or system +failure, or they must be replicated to other systems. +<p>In applications running on systems without any form of stable storage, +durability must be accomplished through replication. In this case, +database environments should be configured to maintain database logs in +memory, rather than in the filesystem, by specifying the +<a href="../../api_c/env_set_flags.html#DB_LOG_INMEMORY">DB_LOG_INMEMORY</a> flag to the <a href="../../api_c/env_set_flags.html">DB_ENV->set_flags</a> method.</p> +</dl> +<p>In systems where the filesystem is backed by Flash memory, the number +of times the Flash memory is written may be a concern. Each of the +three parts of the Berkeley DB database environment normally written to the +filesystem can be configured to minimize the number of times the +filesystem is written:</p> +<dl compact> +<dt>The database environment region files:<dd>On a Flash-based filesystem, the database environment should be placed +in heap or system memory, as described previously. +<dt>The database files:<dd>The Berkeley DB library maintains a cache of database pages. The database +pages are only written to backing physical files when the application +checkpoints the database environment with the <a href="../../api_c/txn_checkpoint.html">DB_ENV->txn_checkpoint</a> method, +when database handles are closed with the <a href="../../api_c/db_close.html">DB->close</a> method, or when +the application explicitly flushes the cache with the <a href="../../api_c/db_sync.html">DB->sync</a> +or <a href="../../api_c/memp_sync.html">DB_ENV->memp_sync</a> methods. +<p>To avoid unnecessary writes of Flash memory due to checkpoints, +applications should decrease the frequency of their checkpoints. This +is especially important in applications which repeatedly modify a +specific database page, as repeatedly writing a database page to the +backing physical file will repeatedly update the same blocks of the +filesystem.</p> +<p>To avoid unnecessary writes of the filesystem due to closing a database +handle, applications should specify the <a href="../../api_c/db_close.html#DB_NOSYNC">DB_NOSYNC</a> flag to the +<a href="../../api_c/db_close.html">DB->close</a> method.</p> +<p>To avoid unnecessary writes of the filesystem due to flushing the cache, +applications should not explicitly flush the cache under normal +conditions -- flushing the cache is rarely if ever needed in a +normally-running application.</p> +<dt>The database environment log files:<dd>The Berkeley DB log files do not repeatedly overwrite the same blocks of the +filesystem as the Berkeley DB log files are not implemented as a circular +buffer and log files are not re-used. For this reason, the Berkeley DB log +files should not cause any difficulties for Flash memory configurations. +<p>However, as Berkeley DB does not write log records in filesystem block sized +pieces, it is probable that sequential transaction commits (each of +which flush the log file to the backing filesystem), will write a block +of Flash memory twice, as the last log record from the first commit will +write the same block of Flash memory as the first log record from the +second commit. Applications not requiring absolute durability should +specify the <a href="../../api_c/env_set_flags.html#DB_TXN_WRITE_NOSYNC">DB_TXN_WRITE_NOSYNC</a> or <a href="../../api_c/env_set_flags.html#DB_TXN_NOSYNC">DB_TXN_NOSYNC</a> flags +to the <a href="../../api_c/env_set_flags.html">DB_ENV->set_flags</a> method to avoid this overwrite of a block of +Flash memory.</p> +</dl> <table width="100%"><tr><td><br></td><td align=right><a href="../program/namespace.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/cache.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> -<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> +<p><font size=1>Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.</font> </body> </html> diff --git a/db/docs/ref/program/runtime.html b/db/docs/ref/program/runtime.html index e28fbd5ed..4e28009f8 100644 --- a/db/docs/ref/program/runtime.html +++ b/db/docs/ref/program/runtime.html @@ -1,5 +1,5 @@ -<!--$Id: runtime.so,v 10.35 2004/03/06 14:49:34 bostic Exp $--> -<!--Copyright 1997-2004 by Sleepycat Software, Inc.--> +<!--$Id: runtime.so,v 10.36 2006/06/08 13:04:29 bostic Exp $--> +<!--Copyright 1997-2006 by Oracle Corporation--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> @@ -15,11 +15,11 @@ </td></tr></table> <p> <h3 align=center>Run-time configuration</h3> -<p>It is possible to configure Berkeley DB at run-time so applications can -redirect all Berkeley DB calls to underlying library or system call -functionality. For example, an application might want Berkeley DB to call -debugging memory allocation routines rather than the standard C library -interfaces. The following interfaces support this functionality:</p> +<p>It is possible for applications to configure Berkeley DB at run-time to +redirect Berkeley DB library and system calls to alternate interfaces. For +example, an application might want Berkeley DB to call debugging memory +allocation routines rather than the standard C library interfaces. The +following interfaces support this functionality:</p> <blockquote><pre><a href="../../api_c/set_func_close.html">db_env_set_func_close</a> <a href="../../api_c/set_func_dirfree.html">db_env_set_func_dirfree</a> <a href="../../api_c/set_func_dirlist.html">db_env_set_func_dirlist</a> @@ -42,8 +42,8 @@ interfaces. The following interfaces support this functionality:</p> <a href="../../api_c/set_func_unmap.html">db_env_set_func_unmap</a> <a href="../../api_c/set_func_write.html">db_env_set_func_write</a> <a href="../../api_c/set_func_yield.html">db_env_set_func_yield</a></pre></blockquote> -<p>These interfaces are available only from the Berkeley DB C language API, and -are not available from all of the operating systems Berkeley DB supports.</p> +<p>These interfaces are available only on POSIX platforms and from the +Berkeley DB C language API.</p> <p>A not-uncommon problem for applications is the new API in Solaris 2.6 for manipulating large files. Because this API was not part of Solaris 2.5, it is difficult to create a single binary that takes advantage of @@ -54,6 +54,6 @@ written using previous versions of the Berkeley DB APIs, and is only useful as an example.</p> <table width="100%"><tr><td><br></td><td align=right><a href="../program/compatible.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/faq.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> -<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> +<p><font size=1>Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.</font> </body> </html> diff --git a/db/docs/ref/program/scope.html b/db/docs/ref/program/scope.html index 5262f3758..c38adf0ac 100644 --- a/db/docs/ref/program/scope.html +++ b/db/docs/ref/program/scope.html @@ -1,5 +1,5 @@ <!--$Id: scope.so,v 10.11 2003/10/24 22:27:56 bostic Exp $--> -<!--Copyright 1997-2004 by Sleepycat Software, Inc.--> +<!--Copyright 1997-2006 by Oracle Corporation--> <!--All rights reserved.--> <!--See the file LICENSE for redistribution information.--> <html> @@ -74,6 +74,6 @@ method's return. </dl> <table width="100%"><tr><td><br></td><td align=right><a href="../program/mt.html"><img src="../../images/prev.gif" alt="Prev"></a><a href="../toc.html"><img src="../../images/ref.gif" alt="Ref"></a><a href="../program/namespace.html"><img src="../../images/next.gif" alt="Next"></a> </td></tr></table> -<p><font size=1><a href="../../sleepycat/legal.html">Copyright (c) 1996-2004</a> <a href="http://www.sleepycat.com">Sleepycat Software, Inc.</a> - All rights reserved.</font> +<p><font size=1>Copyright (c) 1996-2006 Oracle Corporation - All rights reserved.</font> </body> </html> |