| 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>DB_ENV->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 DB_ENV Handle" /> |
| 11 | <link rel="prev" href="envset_memory_max.html" title="DB_ENV->set_memory_max()" /> |
| 12 | <link rel="next" href="envset_msgcall.html" title="DB_ENV->set_msgcall()" /> |
| 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">DB_ENV->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 DB_ENV Handle |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="envset_msgcall.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>DB_ENV->set_metadata_dir()</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">#include <db.h> |
| 42 | |
| 43 | int |
| 44 | DB_ENV->set_metadata_dir(DB_ENV *envp, const char *dir); </pre> |
| 45 | <p> |
| 46 | The <code class="methodname">DB_ENV->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">DB_ENV->set_metadata_dir()</code> method may |
| 57 | not be called after the <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> |
| 58 | method is called. The directory identified by this method must |
| 59 | already exist when the <code class="methodname">DB_ENV->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">DB_ENV->set_metadata_dir()</code> <span> |
| 77 | <span> |
| 78 | method returns a non-zero error value on failure and 0 on success. |
| 79 | </span> |
| 80 | |
| 81 | </span> |
| 82 | </p> |
| 83 | <div class="sect2" lang="en" xml:lang="en"> |
| 84 | <div class="titlepage"> |
| 85 | <div> |
| 86 | <div> |
| 87 | <h3 class="title"><a id="idp52149368"></a>Parameters</h3> |
| 88 | </div> |
| 89 | </div> |
| 90 | </div> |
| 91 | <div class="sect3" lang="en" xml:lang="en"> |
| 92 | <div class="titlepage"> |
| 93 | <div> |
| 94 | <div> |
| 95 | <h4 class="title"><a id="idp52181656"></a>dir</h4> |
| 96 | </div> |
| 97 | </div> |
| 98 | </div> |
| 99 | <p> |
| 100 | The <span class="bold"><strong>dir</strong></span> parameter |
| 101 | identifies the directory used to store persistent metadata |
| 102 | files. |
| 103 | </p> |
| 104 | </div> |
| 105 | </div> |
| 106 | <div class="sect2" lang="en" xml:lang="en"> |
| 107 | <div class="titlepage"> |
| 108 | <div> |
| 109 | <div> |
| 110 | <h3 class="title"><a id="idp52111208"></a>Class</h3> |
| 111 | </div> |
| 112 | </div> |
| 113 | </div> |
| 114 | <p> |
| 115 | <a class="link" href="env.html" title="Chapter 5. The DB_ENV Handle">DB_ENV</a> |
| 116 | </p> |
| 117 | </div> |
| 118 | <div class="sect2" lang="en" xml:lang="en"> |
| 119 | <div class="titlepage"> |
| 120 | <div> |
| 121 | <div> |
| 122 | <h3 class="title"><a id="idp52160336"></a>See Also</h3> |
| 123 | </div> |
| 124 | </div> |
| 125 | </div> |
| 126 | <p> |
| 127 | <a class="xref" href="env.html#envlist" title="Database Environments and Related Methods">Database Environments and Related Methods</a>, |
| 128 | <a class="xref" href="envget_metadata_dir.html" title="DB_ENV->get_metadata_dir()">DB_ENV->get_metadata_dir()</a> |
| 129 | </p> |
| 130 | </div> |
| 131 | </div> |
| 132 | <div class="navfooter"> |
| 133 | <hr /> |
| 134 | <table width="100%" summary="Navigation footer"> |
| 135 | <tr> |
| 136 | <td width="40%" align="left"><a accesskey="p" href="envset_memory_max.html">Prev</a> </td> |
| 137 | <td width="20%" align="center"> |
| 138 | <a accesskey="u" href="env.html">Up</a> |
| 139 | </td> |
| 140 | <td width="40%" align="right"> <a accesskey="n" href="envset_msgcall.html">Next</a></td> |
| 141 | </tr> |
| 142 | <tr> |
| 143 | <td width="40%" align="left" valign="top">DB_ENV->set_memory_max() </td> |
| 144 | <td width="20%" align="center"> |
| 145 | <a accesskey="h" href="index.html">Home</a> |
| 146 | </td> |
| 147 | <td width="40%" align="right" valign="top"> DB_ENV->set_msgcall()</td> |
| 148 | </tr> |
| 149 | </table> |
| 150 | </div> |
| 151 | </body> |
| 152 | </html> |