| 1 | <?xml version="1.0" encoding="UTF-8" standalone="no"?> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
| 6 | <title>Chapter 5. The DB_ENV Handle</title> |
| 7 | <link rel="stylesheet" href="apiReference.css" type="text/css" /> |
| 8 | <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 | <link rel="start" href="index.html" title="Berkeley DB C API Reference" /> |
| 10 | <link rel="up" href="index.html" title="Berkeley DB C API Reference" /> |
| 11 | <link rel="prev" href="DB_MULTIPLE_RECNO_RESERVE_NEXT.html" title="DB_MULTIPLE_RECNO_RESERVE_NEXT" /> |
| 12 | <link rel="next" href="envadd_data_dir.html" title="DB_ENV->add_data_dir()" /> |
| 13 | </head> |
| 14 | <body> |
| 15 | <div xmlns="" class="navheader"> |
| 16 | <div class="libver"> |
| 17 | <p>Library Version 11.2.5.3</p> |
| 18 | </div> |
| 19 | <table width="100%" summary="Navigation header"> |
| 20 | <tr> |
| 21 | <th colspan="3" align="center">Chapter 5. |
| 22 | The DB_ENV Handle |
| 23 | </th> |
| 24 | </tr> |
| 25 | <tr> |
| 26 | <td width="20%" align="left"><a accesskey="p" href="DB_MULTIPLE_RECNO_RESERVE_NEXT.html">Prev</a> </td> |
| 27 | <th width="60%" align="center"> </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="envadd_data_dir.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="chapter" lang="en" xml:lang="en"> |
| 34 | <div class="titlepage"> |
| 35 | <div> |
| 36 | <div> |
| 37 | <h2 class="title"><a id="env"></a>Chapter 5. |
| 38 | The DB_ENV Handle |
| 39 | </h2> |
| 40 | </div> |
| 41 | </div> |
| 42 | </div> |
| 43 | <p> |
| 44 | The <code class="classname">DB_ENV</code> object is the handle for a Berkeley DB environment |
| 45 | — a collection including support for some or all of caching, locking, logging and |
| 46 | transaction subsystems, as well as databases and log files. Methods of the |
| 47 | <code class="classname">DB_ENV</code> handle are used to configure the environment as well as |
| 48 | to operate on subsystems and databases in the environment. |
| 49 | </p> |
| 50 | <p> |
| 51 | <code class="classname">DB_ENV</code> handles |
| 52 | <span> |
| 53 | are created using the <a class="xref" href="envcreate.html" title="db_env_create">db_env_create</a> |
| 54 | method, and |
| 55 | </span> |
| 56 | are opened using the <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> |
| 57 | method. |
| 58 | </p> |
| 59 | <p> |
| 60 | When you are done using your environment, close it using the |
| 61 | <a class="xref" href="envclose.html" title="DB_ENV->close()">DB_ENV->close()</a> method. Before closing your |
| 62 | environment, make sure all open database handles are closed first. See the |
| 63 | <a class="xref" href="dbclose.html" title="DB->close()">DB->close()</a> method for more information. |
| 64 | </p> |
| 65 | <div class="sect1" lang="en" xml:lang="en"> |
| 66 | <div class="titlepage"> |
| 67 | <div> |
| 68 | <div> |
| 69 | <h2 class="title" style="clear: both"><a id="envlist"></a>Database Environments and Related Methods</h2> |
| 70 | </div> |
| 71 | </div> |
| 72 | </div> |
| 73 | <div class="navtable"> |
| 74 | <table border="1" width="80%"> |
| 75 | <thead> |
| 76 | <tr> |
| 77 | <th>Database Environment Operations</th> |
| 78 | <th>Description</th> |
| 79 | </tr> |
| 80 | </thead> |
| 81 | <tbody> |
| 82 | <tr> |
| 83 | <td> |
| 84 | <a class="xref" href="envbackup.html" title="DB_ENV->backup()">DB_ENV->backup()</a> |
| 85 | </td> |
| 86 | <td>Hot back up an entire environment</td> |
| 87 | </tr> |
| 88 | <tr> |
| 89 | <td> |
| 90 | <a class="xref" href="envclose.html" title="DB_ENV->close()">DB_ENV->close()</a> |
| 91 | </td> |
| 92 | <td>Close an environment</td> |
| 93 | </tr> |
| 94 | <tr> |
| 95 | <td> |
| 96 | <a class="xref" href="envcreate.html" title="db_env_create">db_env_create</a> |
| 97 | </td> |
| 98 | <td>Create an environment handle</td> |
| 99 | </tr> |
| 100 | <tr> |
| 101 | <td> |
| 102 | <a class="xref" href="envdbbackup.html" title="DB_ENV->dbbackup()">DB_ENV->dbbackup()</a> |
| 103 | </td> |
| 104 | <td>Hot back up a single environment file</td> |
| 105 | </tr> |
| 106 | <tr> |
| 107 | <td> |
| 108 | <a class="xref" href="envdbremove.html" title="DB_ENV->dbremove()">DB_ENV->dbremove()</a> |
| 109 | </td> |
| 110 | <td>Remove a database</td> |
| 111 | </tr> |
| 112 | <tr> |
| 113 | <td> |
| 114 | <a class="xref" href="envdbrename.html" title="DB_ENV->dbrename()">DB_ENV->dbrename()</a> |
| 115 | </td> |
| 116 | <td>Rename a database</td> |
| 117 | </tr> |
| 118 | <tr> |
| 119 | <td> |
| 120 | <a class="xref" href="enverr.html" title="DB_ENV->err()">DB_ENV->err()</a> |
| 121 | </td> |
| 122 | <td>Error message</td> |
| 123 | </tr> |
| 124 | <tr> |
| 125 | <td> |
| 126 | <a class="xref" href="envfailchk.html" title="DB_ENV->failchk()">DB_ENV->failchk()</a> |
| 127 | </td> |
| 128 | <td>Check for thread failure</td> |
| 129 | </tr> |
| 130 | <tr> |
| 131 | <td> |
| 132 | <a class="xref" href="envfileid_reset.html" title="DB_ENV->fileid_reset()">DB_ENV->fileid_reset()</a> |
| 133 | </td> |
| 134 | <td>Reset database file IDs</td> |
| 135 | </tr> |
| 136 | <tr> |
| 137 | <td> |
| 138 | <a class="xref" href="envfullversion.html" title="db_full_version">db_full_version</a> |
| 139 | </td> |
| 140 | <td>Return full version information</td> |
| 141 | </tr> |
| 142 | <tr> |
| 143 | <td> |
| 144 | <a class="xref" href="dbgetenv.html" title="DB->get_env()">DB->get_env()</a> |
| 145 | </td> |
| 146 | <td>Return the DB's underlying DB_ENV handle </td> |
| 147 | </tr> |
| 148 | <tr> |
| 149 | <td> |
| 150 | <a class="xref" href="envget_home.html" title="DB_ENV->get_home()">DB_ENV->get_home()</a> |
| 151 | </td> |
| 152 | <td>Return environment's home directory</td> |
| 153 | </tr> |
| 154 | <tr> |
| 155 | <td> |
| 156 | <a class="xref" href="envget_open_flags.html" title="DB_ENV->get_open_flags()">DB_ENV->get_open_flags()</a> |
| 157 | </td> |
| 158 | <td>Return flags with which the environment was opened</td> |
| 159 | </tr> |
| 160 | <tr> |
| 161 | <td> |
| 162 | <a class="xref" href="envlog_verify.html" title="DB_ENV->log_verify()">DB_ENV->log_verify()</a> |
| 163 | </td> |
| 164 | <td>Verify log files of an environment.</td> |
| 165 | </tr> |
| 166 | <tr> |
| 167 | <td> |
| 168 | <a class="xref" href="envlsn_reset.html" title="DB_ENV->lsn_reset()">DB_ENV->lsn_reset()</a> |
| 169 | </td> |
| 170 | <td>Reset database file LSNs</td> |
| 171 | </tr> |
| 172 | <tr> |
| 173 | <td> |
| 174 | <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> |
| 175 | </td> |
| 176 | <td>Open an environment</td> |
| 177 | </tr> |
| 178 | <tr> |
| 179 | <td> |
| 180 | <a class="xref" href="envremove.html" title="DB_ENV->remove()">DB_ENV->remove()</a> |
| 181 | </td> |
| 182 | <td>Remove an environment</td> |
| 183 | </tr> |
| 184 | <tr> |
| 185 | <td> |
| 186 | <a class="xref" href="envstat.html" title="DB_ENV->stat_print()">DB_ENV->stat_print()</a> |
| 187 | </td> |
| 188 | <td>Environment statistics</td> |
| 189 | </tr> |
| 190 | <tr> |
| 191 | <td> |
| 192 | <a class="xref" href="envstrerror.html" title="db_strerror">db_strerror</a> |
| 193 | </td> |
| 194 | <td>Error strings</td> |
| 195 | </tr> |
| 196 | <tr> |
| 197 | <td> |
| 198 | <a class="xref" href="envversion.html" title="db_version">db_version</a> |
| 199 | </td> |
| 200 | <td>Return version information</td> |
| 201 | </tr> |
| 202 | <tr> |
| 203 | <td colspan="2"> |
| 204 | <span class="bold"> |
| 205 | <strong>Environment Configuration</strong> |
| 206 | </span> |
| 207 | </td> |
| 208 | </tr> |
| 209 | <tr> |
| 210 | <td> |
| 211 | <a class="xref" href="envadd_data_dir.html" title="DB_ENV->add_data_dir()">DB_ENV->add_data_dir()</a> |
| 212 | </td> |
| 213 | <td>Add an environment data directory</td> |
| 214 | </tr> |
| 215 | <tr> |
| 216 | <td> |
| 217 | <a class="xref" href="envset_alloc.html" title="DB_ENV->set_alloc()">DB_ENV->set_alloc()</a> |
| 218 | </td> |
| 219 | <td>Set local space allocation functions</td> |
| 220 | </tr> |
| 221 | <tr> |
| 222 | <td> |
| 223 | <a class="xref" href="envset_app_dispatch.html" title="DB_ENV->set_app_dispatch()">DB_ENV->set_app_dispatch()</a> |
| 224 | </td> |
| 225 | <td>Configure application recovery callback</td> |
| 226 | </tr> |
| 227 | <tr> |
| 228 | <td><a class="xref" href="envset_backup_callbacks.html" title="DB_ENV->set_backup_callbacks()">DB_ENV->set_backup_callbacks()</a>, <a class="xref" href="envget_backup_callbacks.html" title="DB_ENV->get_backup_callbacks()">DB_ENV->get_backup_callbacks()</a></td> |
| 229 | <td>Set/get callbacks used for environment hot backups</td> |
| 230 | </tr> |
| 231 | <tr> |
| 232 | <td><a class="xref" href="envset_backup_config.html" title="DB_ENV->set_backup_config()">DB_ENV->set_backup_config()</a>, <a class="xref" href="envget_backup_config.html" title="DB_ENV->get_backup_config()">DB_ENV->get_backup_config()</a></td> |
| 233 | <td>Set/get environment hot backup configuration options</td> |
| 234 | </tr> |
| 235 | <tr> |
| 236 | <td><a class="xref" href="envset_data_dir.html" title="DB_ENV->set_data_dir()">DB_ENV->set_data_dir()</a>, <a class="xref" href="envget_data_dirs.html" title="DB_ENV->get_data_dirs()">DB_ENV->get_data_dirs()</a></td> |
| 237 | <td>Set/get the environment data directory</td> |
| 238 | </tr> |
| 239 | <tr> |
| 240 | <td><a class="xref" href="envset_data_len.html" title="DB_ENV->set_data_len()">DB_ENV->set_data_len()</a>, <a class="xref" href="envget_data_len.html" title="DB_ENV->get_data_len()">DB_ENV->get_data_len()</a></td> |
| 241 | <td>Set/get the command line utility byte limit</td> |
| 242 | </tr> |
| 243 | <tr> |
| 244 | <td><a class="xref" href="envset_create_dir.html" title="DB_ENV->set_create_dir()">DB_ENV->set_create_dir()</a>, <a class="xref" href="envget_create_dir.html" title="DB_ENV->get_create_dir()">DB_ENV->get_create_dir()</a></td> |
| 245 | <td>Add an environment data directory</td> |
| 246 | </tr> |
| 247 | <tr> |
| 248 | <td><a class="xref" href="envset_encrypt.html" title="DB_ENV->set_encrypt()">DB_ENV->set_encrypt()</a>, <a class="xref" href="envget_encrypt_flags.html" title="DB_ENV->get_encrypt_flags()">DB_ENV->get_encrypt_flags()</a></td> |
| 249 | <td>Set/get the environment cryptographic key</td> |
| 250 | </tr> |
| 251 | <tr> |
| 252 | <td> |
| 253 | <a class="xref" href="envevent_notify.html" title="DB_ENV->set_event_notify()">DB_ENV->set_event_notify()</a> |
| 254 | </td> |
| 255 | <td>Set event notification callback</td> |
| 256 | </tr> |
| 257 | <tr> |
| 258 | <td> |
| 259 | <a class="xref" href="envset_errcall.html" title="DB_ENV->set_errcall()">DB_ENV->set_errcall()</a> |
| 260 | </td> |
| 261 | <td>Set error message callbacks</td> |
| 262 | </tr> |
| 263 | <tr> |
| 264 | <td><a class="xref" href="envset_errfile.html" title="DB_ENV->set_errfile()">DB_ENV->set_errfile()</a>, <a class="xref" href="envget_errfile.html" title="DB_ENV->get_errfile()">DB_ENV->get_errfile()</a></td> |
| 265 | <td>Set/get error message FILE</td> |
| 266 | </tr> |
| 267 | <tr> |
| 268 | <td><a class="xref" href="envset_errpfx.html" title="DB_ENV->set_errpfx()">DB_ENV->set_errpfx()</a>, <a class="xref" href="envget_errpfx.html" title="DB_ENV->get_errpfx()">DB_ENV->get_errpfx()</a></td> |
| 269 | <td>Set/get error message prefix</td> |
| 270 | </tr> |
| 271 | <tr> |
| 272 | <td> |
| 273 | <a class="xref" href="envset_feedback.html" title="DB_ENV->set_feedback()">DB_ENV->set_feedback()</a> |
| 274 | </td> |
| 275 | <td>Set feedback callback</td> |
| 276 | </tr> |
| 277 | <tr> |
| 278 | <td><a class="xref" href="envset_flags.html" title="DB_ENV->set_flags()">DB_ENV->set_flags()</a>, <a class="xref" href="envget_flags.html" title="DB_ENV->get_flags()">DB_ENV->get_flags()</a></td> |
| 279 | <td>Environment configuration</td> |
| 280 | </tr> |
| 281 | <tr> |
| 282 | <td><a class="xref" href="envset_intermediate_dir_mode.html" title="DB_ENV->set_intermediate_dir_mode()">DB_ENV->set_intermediate_dir_mode()</a>, <a class="xref" href="envget_intermediate_dir_mode.html" title="DB_ENV->get_intermediate_dir_mode()">DB_ENV->get_intermediate_dir_mode()</a></td> |
| 283 | <td>Set/get intermediate directory creation mode</td> |
| 284 | </tr> |
| 285 | <tr> |
| 286 | <td> |
| 287 | <a class="xref" href="envset_isalive.html" title="DB_ENV->set_isalive()">DB_ENV->set_isalive()</a> |
| 288 | </td> |
| 289 | <td>Set thread is-alive callback</td> |
| 290 | </tr> |
| 291 | <tr> |
| 292 | <td><a class="xref" href="envset_memory_init.html" title="DB_ENV->set_memory_init()">DB_ENV->set_memory_init()</a>, <a class="xref" href="envget_memory_init.html" title="DB_ENV->get_memory_init()">DB_ENV->get_memory_init()</a></td> |
| 293 | <td>Set/get initial memory allocation</td> |
| 294 | </tr> |
| 295 | <tr> |
| 296 | <td><a class="xref" href="envset_memory_max.html" title="DB_ENV->set_memory_max()">DB_ENV->set_memory_max()</a>, <a class="xref" href="envget_memory_max.html" title="DB_ENV->get_memory_max()">DB_ENV->get_memory_max()</a></td> |
| 297 | <td>Set/get maximum memory allocation</td> |
| 298 | </tr> |
| 299 | <tr> |
| 300 | <td><a class="xref" href="envset_metadata_dir.html" title="DB_ENV->set_metadata_dir()">DB_ENV->set_metadata_dir()</a>, <a class="xref" href="envget_metadata_dir.html" title="DB_ENV->get_metadata_dir()">DB_ENV->get_metadata_dir()</a></td> |
| 301 | <td>Set/get the directory containing environment metadata </td> |
| 302 | </tr> |
| 303 | <tr> |
| 304 | <td> |
| 305 | <a class="xref" href="envset_msgcall.html" title="DB_ENV->set_msgcall()">DB_ENV->set_msgcall()</a> |
| 306 | </td> |
| 307 | <td>Set informational message callback</td> |
| 308 | </tr> |
| 309 | <tr> |
| 310 | <td><a class="xref" href="envset_msgfile.html" title="DB_ENV->set_msgfile()">DB_ENV->set_msgfile()</a>, <a class="xref" href="envget_msgfile.html" title="DB_ENV->get_msgfile()">DB_ENV->get_msgfile()</a></td> |
| 311 | <td>Set/get informational message FILE</td> |
| 312 | </tr> |
| 313 | <tr> |
| 314 | <td><a class="xref" href="envset_shm_key.html" title="DB_ENV->set_shm_key()">DB_ENV->set_shm_key()</a>, <a class="xref" href="envget_shm_key.html" title="DB_ENV->get_shm_key()">DB_ENV->get_shm_key()</a></td> |
| 315 | <td>Set/get system memory shared segment ID</td> |
| 316 | </tr> |
| 317 | <tr> |
| 318 | <td><a class="xref" href="envset_thread_count.html" title="DB_ENV->set_thread_count()">DB_ENV->set_thread_count()</a>, <a class="xref" href="envget_thread_count.html" title="DB_ENV->get_thread_count()">DB_ENV->get_thread_count()</a></td> |
| 319 | <td>Set/get approximate thread count</td> |
| 320 | </tr> |
| 321 | <tr> |
| 322 | <td> |
| 323 | <a class="xref" href="envset_thread_id.html" title="DB_ENV->set_thread_id()">DB_ENV->set_thread_id()</a> |
| 324 | </td> |
| 325 | <td>Set thread of control ID function</td> |
| 326 | </tr> |
| 327 | <tr> |
| 328 | <td> |
| 329 | <a class="xref" href="envset_thread_id_string.html" title="DB_ENV->set_thread_id_string()">DB_ENV->set_thread_id_string()</a> |
| 330 | </td> |
| 331 | <td>Set thread of control ID format function</td> |
| 332 | </tr> |
| 333 | <tr> |
| 334 | <td><a class="xref" href="envset_timeout.html" title="DB_ENV->set_timeout()">DB_ENV->set_timeout()</a>, <a class="xref" href="envget_timeout.html" title="DB_ENV->get_timeout()">DB_ENV->get_timeout()</a></td> |
| 335 | <td>Set/get lock and transaction timeout</td> |
| 336 | </tr> |
| 337 | <tr> |
| 338 | <td><a class="xref" href="envset_tmp_dir.html" title="DB_ENV->set_tmp_dir()">DB_ENV->set_tmp_dir()</a>, <a class="xref" href="envget_tmp_dir.html" title="DB_ENV->get_tmp_dir()">DB_ENV->get_tmp_dir()</a></td> |
| 339 | <td>Set/get the environment temporary file directory</td> |
| 340 | </tr> |
| 341 | <tr> |
| 342 | <td><a class="xref" href="envset_verbose.html" title="DB_ENV->set_verbose()">DB_ENV->set_verbose()</a>, <a class="xref" href="envget_verbose.html" title="DB_ENV->get_verbose()">DB_ENV->get_verbose()</a></td> |
| 343 | <td>Set/get verbose messages</td> |
| 344 | </tr> |
| 345 | <tr> |
| 346 | <td><a class="xref" href="envset_cachesize.html" title="DB_ENV->set_cachesize()">DB_ENV->set_cachesize()</a>, <a class="xref" href="envget_cachesize.html" title="DB_ENV->get_cachesize()">DB_ENV->get_cachesize()</a></td> |
| 347 | <td>Set/get the environment cache size</td> |
| 348 | </tr> |
| 349 | </tbody> |
| 350 | </table> |
| 351 | </div> |
| 352 | </div> |
| 353 | </div> |
| 354 | <div class="navfooter"> |
| 355 | <hr /> |
| 356 | <table width="100%" summary="Navigation footer"> |
| 357 | <tr> |
| 358 | <td width="40%" align="left"><a accesskey="p" href="DB_MULTIPLE_RECNO_RESERVE_NEXT.html">Prev</a> </td> |
| 359 | <td width="20%" align="center"> </td> |
| 360 | <td width="40%" align="right"> <a accesskey="n" href="envadd_data_dir.html">Next</a></td> |
| 361 | </tr> |
| 362 | <tr> |
| 363 | <td width="40%" align="left" valign="top">DB_MULTIPLE_RECNO_RESERVE_NEXT </td> |
| 364 | <td width="20%" align="center"> |
| 365 | <a accesskey="h" href="index.html">Home</a> |
| 366 | </td> |
| 367 | <td width="40%" align="right" valign="top"> DB_ENV->add_data_dir()</td> |
| 368 | </tr> |
| 369 | </table> |
| 370 | </div> |
| 371 | </body> |
| 372 | </html> |