| 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>DbEnv::set_metadata_dir()</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="env.html" title="Chapter 5. The DbEnv Handle" /> |
| 11 | <link rel="prev" href="envset_memory_max.html" title="DbEnv::set_memory_max()" /> |
| 12 | <link rel="next" href="envset_message_stream.html" title="DbEnv::set_message_stream()" /> |
| 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">DbEnv::set_metadata_dir()</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="envset_memory_max.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 5. |
| 26 | The DbEnv Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="envset_message_stream.html">Next</a></td> |
| 29 | </tr> |
| 30 | </table> |
| 31 | <hr /> |
| 32 | </div> |
| 33 | <div class="sect1" lang="en" xml:lang="en"> |
| 34 | <div class="titlepage"> |
| 35 | <div> |
| 36 | <div> |
| 37 | <h2 class="title" style="clear: both"><a id="envset_metadata_dir"></a>DbEnv::set_metadata_dir()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db_cxx.h> |
| 42 | |
| 43 | int |
| 44 | DbEnv::set_metadata_dir(const char *dir);</pre> |
| 45 | <p> |
| 46 | The <code class="methodname">DbEnv::set_metadata_dir()</code> method sets |
| 47 | the directory where persistent metadata is stored. By default, |
| 48 | persistent metadata is stored in the environment home |
| 49 | directory. |
| 50 | </p> |
| 51 | <p> |
| 52 | When used in a replicated application, the metadata directory must |
| 53 | be the same location for all sites within a replication group. |
| 54 | </p> |
| 55 | <p> |
| 56 | The <code class="methodname">DbEnv::set_metadata_dir()</code> method may |
| 57 | not be called after the <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> |
| 58 | method is called. The directory identified by this method must |
| 59 | already exist when the <code class="methodname">DbEnv::open()</code> |
| 60 | method is called. The directory identified by this method is added |
| 61 | to the environment's list of data directories, if this directory |
| 62 | is not already included on that list. |
| 63 | </p> |
| 64 | <p> |
| 65 | The database environment's metadata directory may also be configured |
| 66 | using the environment's |
| 67 | <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> |
| 68 | file. The syntax of the entry in that file is a single line with |
| 69 | the string "set_metadata_dir", one or more whitespace characters, |
| 70 | followed by the directory location. Because the |
| 71 | <a href="../../programmer_reference/env_db_config.html#env_db_config.DB_CONFIG" class="olink">DB_CONFIG</a> |
| 72 | file is read when the database environment is opened, it will |
| 73 | silently overrule configuration done before that time. |
| 74 | </p> |
| 75 | <p> |
| 76 | The <code class="methodname">DbEnv::set_metadata_dir()</code> <span> |
| 77 | |
| 78 | <span> |
| 79 | method either returns a non-zero error value or throws an |
| 80 | exception that encapsulates a non-zero error value on |
| 81 | failure, and returns 0 on success. |
| 82 | </span> |
| 83 | </span> |
| 84 | </p> |
| 85 | <div class="sect2" lang="en" xml:lang="en"> |
| 86 | <div class="titlepage"> |
| 87 | <div> |
| 88 | <div> |
| 89 | <h3 class="title"><a id="idp7540800"></a>Parameters</h3> |
| 90 | </div> |
| 91 | </div> |
| 92 | </div> |
| 93 | <div class="sect3" lang="en" xml:lang="en"> |
| 94 | <div class="titlepage"> |
| 95 | <div> |
| 96 | <div> |
| 97 | <h4 class="title"><a id="idp7541400"></a>dir</h4> |
| 98 | </div> |
| 99 | </div> |
| 100 | </div> |
| 101 | <p> |
| 102 | The <span class="bold"><strong>dir</strong></span> parameter |
| 103 | identifies the directory used to store persistent metadata |
| 104 | files. |
| 105 | </p> |
| 106 | </div> |
| 107 | </div> |
| 108 | <div class="sect2" lang="en" xml:lang="en"> |
| 109 | <div class="titlepage"> |
| 110 | <div> |
| 111 | <div> |
| 112 | <h3 class="title"><a id="idp7534456"></a>Class</h3> |
| 113 | </div> |
| 114 | </div> |
| 115 | </div> |
| 116 | <p> |
| 117 | <a class="link" href="env.html" title="Chapter 5. The DbEnv Handle">DbEnv</a> |
| 118 | </p> |
| 119 | </div> |
| 120 | <div class="sect2" lang="en" xml:lang="en"> |
| 121 | <div class="titlepage"> |
| 122 | <div> |
| 123 | <div> |
| 124 | <h3 class="title"><a id="idp7490808"></a>See Also</h3> |
| 125 | </div> |
| 126 | </div> |
| 127 | </div> |
| 128 | <p> |
| 129 | <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>, |
| 130 | <a class="xref" href="envget_metadata_dir.html" title="DbEnv::get_metadata_dir()">DbEnv::get_metadata_dir()</a> |
| 131 | </p> |
| 132 | </div> |
| 133 | </div> |
| 134 | <div class="navfooter"> |
| 135 | <hr /> |
| 136 | <table width="100%" summary="Navigation footer"> |
| 137 | <tr> |
| 138 | <td width="40%" align="left"><a accesskey="p" href="envset_memory_max.html">Prev</a> </td> |
| 139 | <td width="20%" align="center"> |
| 140 | <a accesskey="u" href="env.html">Up</a> |
| 141 | </td> |
| 142 | <td width="40%" align="right"> <a accesskey="n" href="envset_message_stream.html">Next</a></td> |
| 143 | </tr> |
| 144 | <tr> |
| 145 | <td width="40%" align="left" valign="top">DbEnv::set_memory_max() </td> |
| 146 | <td width="20%" align="center"> |
| 147 | <a accesskey="h" href="index.html">Home</a> |
| 148 | </td> |
| 149 | <td width="40%" align="right" valign="top"> DbEnv::set_message_stream()</td> |
| 150 | </tr> |
| 151 | </table> |
| 152 | </div> |
| 153 | </body> |
| 154 | </html> |