<?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>Managing the Locking Subsystem</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="configure.html" title="Chapter 3. Configuring the Berkeley DB SQL interface" /> <link rel="prev" href="admin-logfile.html" title="Administering Log Files" /> <link rel="next" href="admin.html" title="Chapter 4. Administrating Berkeley DB SQL Databases" /> </head> <body> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr> <th colspan="3" align="center">Managing the Locking Subsystem</th> </tr> <tr> <td width="20%" align="left"><a accesskey="p" href="admin-logfile.html">Prev</a> </td> <th width="60%" align="center">Chapter 3. Configuring the Berkeley DB SQL interface</th> <td width="20%" align="right"> <a accesskey="n" href="admin.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="admin-locking"></a>Managing the Locking Subsystem</h2> </div> </div> </div> <p> Whenever the BDB SQL interface reads from or writes to the database, the underlying Berkeley DB code must acquire locks. These locks represent a finite resource. For most installations, you should never have to worry about the locking resources available to Berkeley DB because the default values are appropriate for most applications. </p> <p> However, if your application is using an extremely large number of threads that are all simultaneously accessing your data, then you might have to increase your locking resources. Similarly, if your database contains a very large number of tables that you are accessing using one or more simultaneous threads or processes, then you might also need to increase your locking resources. </p> <p> On the other hand, if you are using the BDB SQL interface on devices with extremely limited resources, then you might want to reduce your locking resources. </p> <p> All of these values must be configured before your environment is first created. To change these values after environment creation time, you must re-create the environment. See <a class="xref" href="using_dbconfig.html" title="The DB_CONFIG File">The DB_CONFIG File</a> for more information. </p> <p> The maximum locking values that you can manage, and the <code class="literal">DB_CONFIG</code> parameter that you use to manage that value, are: </p> <div class="itemizedlist"> <ul type="disc"> <li> <p> The maximum number of lockers supported by the environment. This value is used by the environment when it is opened to estimate the amount of space that it should allocate for various internal data structures. By default, 2,000 lockers are supported. </p> <p> The maximum number of lockers corresponds roughly to the maximum number of concurrent transactions in the system. </p> <p> To configure this value, use the <code class="literal">set_lk_max_lockers</code> DB_CONFIG parameter. See the <a class="ulink" href="http://download.oracle.com/docs/cd/E17076_02/html/api_reference/C/BDB-C_APIReference.pdf" target="_top">Berkeley DB C API </a> for details. </p> </li> <li> <p> The maximum number of locks supported by the environment. By default, 10,000 locks are supported. </p> <p> To configure this value, use the <code class="literal">set_lk_max_locks</code> DB_CONFIG parameter. See the <a class="ulink" href="http://download.oracle.com/docs/cd/E17076_02/html/api_reference/C/BDB-C_APIReference.pdf" target="_top">Berkeley DB C API </a> for details. </p> </li> <li> <p> The maximum number of locked objects supported by the environment. By default, 10,000 objects can be locked. </p> <p> To configure this value, use the <code class="literal">set_lk_max_objects</code> DB_CONFIG parameter. See the <a class="ulink" href="http://download.oracle.com/docs/cd/E17076_02/html/api_reference/C/BDB-C_APIReference.pdf" target="_top">Berkeley DB C API </a> for details. </p> </li> </ul> </div> <p> Note that when you are using the BDB SQL interface, the default values provided in the previous list are different from the default values used by Berkeley DB in general. For Berkeley DB in general, the defaults for all these values are set to 1,000. </p> </div> <div class="navfooter"> <hr /> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"><a accesskey="p" href="admin-logfile.html">Prev</a> </td> <td width="20%" align="center"> <a accesskey="u" href="configure.html">Up</a> </td> <td width="40%" align="right"> <a accesskey="n" href="admin.html">Next</a></td> </tr> <tr> <td width="40%" align="left" valign="top">Administering Log Files </td> <td width="20%" align="center"> <a accesskey="h" href="index.html">Home</a> </td> <td width="40%" align="right" valign="top"> Chapter 4. Administrating Berkeley DB SQL Databases</td> </tr> </table> </div> </body> </html>