| 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>Replication PRAGMAs</title> |
| 7 | <link rel="stylesheet" href="gettingStarted.css" type="text/css" /> |
| 8 | <meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /> |
| 9 | <link rel="start" href="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> |
| 10 | <link rel="up" href="sqlrep.html" title="Chapter 4. Using Replication with the SQL API" /> |
| 11 | <link rel="prev" href="sqlrep.html" title="Chapter 4. Using Replication with the SQL API" /> |
| 12 | <link rel="next" href="repstatistics.html" title="Displaying Replication Statistics" /> |
| 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">Replication PRAGMAs</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="sqlrep.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Chapter 4. Using Replication with the SQL API</th> |
| 26 | <td width="20%" align="right"> <a accesskey="n" href="repstatistics.html">Next</a></td> |
| 27 | </tr> |
| 28 | </table> |
| 29 | <hr /> |
| 30 | </div> |
| 31 | <div class="sect1" lang="en" xml:lang="en"> |
| 32 | <div class="titlepage"> |
| 33 | <div> |
| 34 | <div> |
| 35 | <h2 class="title" style="clear: both"><a id="reppragma"></a>Replication PRAGMAs</h2> |
| 36 | </div> |
| 37 | </div> |
| 38 | </div> |
| 39 | <div class="toc"> |
| 40 | <dl> |
| 41 | <dt> |
| 42 | <span class="sect2"> |
| 43 | <a href="reppragma.html#pragma_replication">PRAGMA replication</a> |
| 44 | </span> |
| 45 | </dt> |
| 46 | <dt> |
| 47 | <span class="sect2"> |
| 48 | <a href="reppragma.html#pragma_replication_initial_master">PRAGMA replication_initial_master</a> |
| 49 | </span> |
| 50 | </dt> |
| 51 | <dt> |
| 52 | <span class="sect2"> |
| 53 | <a href="reppragma.html#pragma_replication_local_site">PRAGMA replication_local_site</a> |
| 54 | </span> |
| 55 | </dt> |
| 56 | <dt> |
| 57 | <span class="sect2"> |
| 58 | <a href="reppragma.html#pragma_replication_remote_site">PRAGMA replication_remote_site</a> |
| 59 | </span> |
| 60 | </dt> |
| 61 | <dt> |
| 62 | <span class="sect2"> |
| 63 | <a href="reppragma.html#pragma_replication_remove_site">PRAGMA replication_remove_site</a> |
| 64 | </span> |
| 65 | </dt> |
| 66 | <dt> |
| 67 | <span class="sect2"> |
| 68 | <a href="reppragma.html#pragma_replication_verbose_output">PRAGMA replication_verbose_output</a> |
| 69 | </span> |
| 70 | </dt> |
| 71 | <dt> |
| 72 | <span class="sect2"> |
| 73 | <a href="reppragma.html#pragma_replication_verbose_file">PRAGMA replication_verbose_file</a> |
| 74 | </span> |
| 75 | </dt> |
| 76 | </dl> |
| 77 | </div> |
| 78 | <p> |
| 79 | To control replication when using the Berkeley DB SQL |
| 80 | interface, you use the following PRAGMAs. For an example of |
| 81 | how to use these, see |
| 82 | <a class="xref" href="rep_usageexamples.html" title="Replication Usage Examples">Replication Usage Examples</a>. |
| 83 | </p> |
| 84 | <div class="sect2" lang="en" xml:lang="en"> |
| 85 | <div class="titlepage"> |
| 86 | <div> |
| 87 | <div> |
| 88 | <h3 class="title"><a id="pragma_replication"></a>PRAGMA replication</h3> |
| 89 | </div> |
| 90 | </div> |
| 91 | </div> |
| 92 | <pre class="programlisting">PRAGMA replication=ON|OFF </pre> |
| 93 | <p> |
| 94 | Enables the local environment to participate in |
| 95 | replication. |
| 96 | </p> |
| 97 | <p> |
| 98 | Before invoking this PRAGMA for a brand new |
| 99 | database (one that has never been opened), you |
| 100 | must invoke the |
| 101 | <code class="literal">replication_local_site</code> PRAGMA |
| 102 | and then either the |
| 103 | <code class="literal">replication_initial_master</code> or |
| 104 | the <code class="literal">replication_remote_site</code> |
| 105 | PRAGMA. These actions define the way this site fits |
| 106 | into the replication group. |
| 107 | </p> |
| 108 | <p> |
| 109 | If you are enabling replication for an existing |
| 110 | database, it must become the initial master for a |
| 111 | new replication group. You must invoke the |
| 112 | <code class="literal">replication_local_site</code> PRAGMA |
| 113 | followed by the |
| 114 | <code class="literal">replication_initial_master</code> |
| 115 | PRAGMA before enabling replication. |
| 116 | </p> |
| 117 | <p> |
| 118 | If you use this PRAGMA to turn off replication, |
| 119 | then replication is completely disabled for the |
| 120 | environment. In order to enable replication again, |
| 121 | you follow the procedure used to enable replication |
| 122 | on an existing database; that is, invoke the |
| 123 | <code class="literal">replication_local_site</code> PRAGMA |
| 124 | followed by the |
| 125 | <code class="literal">replication_initial_master</code> |
| 126 | PRAGMA, followed by |
| 127 | <code class="literal">PRAGMA replication=ON</code>. |
| 128 | </p> |
| 129 | </div> |
| 130 | <div class="sect2" lang="en" xml:lang="en"> |
| 131 | <div class="titlepage"> |
| 132 | <div> |
| 133 | <div> |
| 134 | <h3 class="title"><a id="pragma_replication_initial_master"></a>PRAGMA replication_initial_master</h3> |
| 135 | </div> |
| 136 | </div> |
| 137 | </div> |
| 138 | <pre class="programlisting">PRAGMA replication_initial_master=ON|OFF </pre> |
| 139 | <p> |
| 140 | Causes the local environment to start up as a |
| 141 | master site. This PRAGMA must be used once and only |
| 142 | once in the replicated lifetime of a BDB SQL |
| 143 | environment. |
| 144 | </p> |
| 145 | <p> |
| 146 | This PRAGMA is usually invoked for the first site in a |
| 147 | new replication group before the |
| 148 | <code class="literal">replication</code> PRAGMA is invoked |
| 149 | and before BDB SQL initially creates the underlying |
| 150 | BDB environment for a SQL database. Starting |
| 151 | replication on the initial master site establishes |
| 152 | the new replication group so that other sites can |
| 153 | join it. |
| 154 | </p> |
| 155 | <p> |
| 156 | However, you must call this PRAGMA |
| 157 | when enabling replication for a database that |
| 158 | already exists. Doing so causes the existing |
| 159 | database to become the replication master for a new |
| 160 | replication group. |
| 161 | </p> |
| 162 | <p> |
| 163 | Note that subsequent election activity can cause |
| 164 | other sites in the replication group to become |
| 165 | master. Do not assume that the initial master site |
| 166 | will remain master indefinitely, or that it will |
| 167 | rejoin the replication group as master after a |
| 168 | shutdown. |
| 169 | </p> |
| 170 | </div> |
| 171 | <div class="sect2" lang="en" xml:lang="en"> |
| 172 | <div class="titlepage"> |
| 173 | <div> |
| 174 | <div> |
| 175 | <h3 class="title"><a id="pragma_replication_local_site"></a>PRAGMA replication_local_site</h3> |
| 176 | </div> |
| 177 | </div> |
| 178 | </div> |
| 179 | <pre class="programlisting">PRAGMA replication_local_site="hostname:port" </pre> |
| 180 | <p> |
| 181 | Sets the local site information for replication. |
| 182 | </p> |
| 183 | </div> |
| 184 | <div class="sect2" lang="en" xml:lang="en"> |
| 185 | <div class="titlepage"> |
| 186 | <div> |
| 187 | <div> |
| 188 | <h3 class="title"><a id="pragma_replication_remote_site"></a>PRAGMA replication_remote_site</h3> |
| 189 | </div> |
| 190 | </div> |
| 191 | </div> |
| 192 | <pre class="programlisting">PRAGMA replication_remote_site="hostname:port" </pre> |
| 193 | <p> |
| 194 | Sets information about a remote helper site in the |
| 195 | replication group. |
| 196 | </p> |
| 197 | <p> |
| 198 | This PRAGMA is needed when a site first joins an |
| 199 | existing replication group to specify a site that |
| 200 | is already in the replication group. It must be |
| 201 | invoked before the <code class="literal">replication</code> |
| 202 | PRAGMA is invoked. This PRAGMA is not needed on |
| 203 | the initial master site or when restarting a site |
| 204 | that is already a member of the replication group. |
| 205 | However, supplying this PRAGMA in those situations |
| 206 | does no harm. |
| 207 | </p> |
| 208 | <p> |
| 209 | Note that the information provided to this PRAGMA |
| 210 | can be superseded by normal replication activity |
| 211 | over the course of the environment's lifetime. |
| 212 | </p> |
| 213 | </div> |
| 214 | <div class="sect2" lang="en" xml:lang="en"> |
| 215 | <div class="titlepage"> |
| 216 | <div> |
| 217 | <div> |
| 218 | <h3 class="title"><a id="pragma_replication_remove_site"></a>PRAGMA replication_remove_site</h3> |
| 219 | </div> |
| 220 | </div> |
| 221 | </div> |
| 222 | <pre class="programlisting">PRAGMA replication_remove_site="hostname:port" </pre> |
| 223 | <p> |
| 224 | Removes the specified site from the replication group. |
| 225 | Use this PRAGMA if you truly want to remove the |
| 226 | site permanently from the group. It is not |
| 227 | desirable to call this PRAGMA if a site has been |
| 228 | temporarily shut down or disconnected from the rest |
| 229 | of the replication group. |
| 230 | </p> |
| 231 | <p> |
| 232 | Removing a site from the replication group means |
| 233 | that the site is no longer counted towards the |
| 234 | total number of sites belonging to the group. This |
| 235 | is important when the replication group requires |
| 236 | knowledge about whether a quorum has been reached |
| 237 | (such as when, for example, elections are held). |
| 238 | </p> |
| 239 | </div> |
| 240 | <div class="sect2" lang="en" xml:lang="en"> |
| 241 | <div class="titlepage"> |
| 242 | <div> |
| 243 | <div> |
| 244 | <h3 class="title"><a id="pragma_replication_verbose_output"></a>PRAGMA replication_verbose_output</h3> |
| 245 | </div> |
| 246 | </div> |
| 247 | </div> |
| 248 | <pre class="programlisting">PRAGMA replication_verbose_output=ON|OFF </pre> |
| 249 | <p> |
| 250 | If set to TRUE, additional logging information |
| 251 | specifically related to replication is created. |
| 252 | </p> |
| 253 | </div> |
| 254 | <div class="sect2" lang="en" xml:lang="en"> |
| 255 | <div class="titlepage"> |
| 256 | <div> |
| 257 | <div> |
| 258 | <h3 class="title"><a id="pragma_replication_verbose_file"></a>PRAGMA replication_verbose_file</h3> |
| 259 | </div> |
| 260 | </div> |
| 261 | </div> |
| 262 | <pre class="programlisting">PRAGMA replication_verbose_file="filename" </pre> |
| 263 | <p> |
| 264 | Indicates that verbose replication output should be |
| 265 | sent to the specified file, as opposed to STDOUT. |
| 266 | </p> |
| 267 | </div> |
| 268 | </div> |
| 269 | <div class="navfooter"> |
| 270 | <hr /> |
| 271 | <table width="100%" summary="Navigation footer"> |
| 272 | <tr> |
| 273 | <td width="40%" align="left"><a accesskey="p" href="sqlrep.html">Prev</a> </td> |
| 274 | <td width="20%" align="center"> |
| 275 | <a accesskey="u" href="sqlrep.html">Up</a> |
| 276 | </td> |
| 277 | <td width="40%" align="right"> <a accesskey="n" href="repstatistics.html">Next</a></td> |
| 278 | </tr> |
| 279 | <tr> |
| 280 | <td width="40%" align="left" valign="top">Chapter 4. Using Replication with the SQL API </td> |
| 281 | <td width="20%" align="center"> |
| 282 | <a accesskey="h" href="index.html">Home</a> |
| 283 | </td> |
| 284 | <td width="40%" align="right" valign="top"> Displaying Replication Statistics</td> |
| 285 | </tr> |
| 286 | </table> |
| 287 | </div> |
| 288 | </body> |
| 289 | </html> |