| 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. Administrating Berkeley DB SQL Databases</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="index.html" title="Getting Started with the Oracle Berkeley DB SQL APIs" /> |
| 11 | <link rel="prev" href="rep_usageexamples.html" title="Replication Usage Examples" /> |
| 12 | <link rel="next" href="sync.html" title="Syncing with Oracle Databases" /> |
| 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. Administrating Berkeley DB SQL Databases</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="rep_usageexamples.html">Prev</a> </td> |
| 25 | <th width="60%" align="center"> </th> |
| 26 | <td width="20%" align="right"> <a accesskey="n" href="sync.html">Next</a></td> |
| 27 | </tr> |
| 28 | </table> |
| 29 | <hr /> |
| 30 | </div> |
| 31 | <div class="chapter" lang="en" xml:lang="en"> |
| 32 | <div class="titlepage"> |
| 33 | <div> |
| 34 | <div> |
| 35 | <h2 class="title"><a id="admin"></a>Chapter 5. Administrating Berkeley DB SQL Databases</h2> |
| 36 | </div> |
| 37 | </div> |
| 38 | </div> |
| 39 | <div class="toc"> |
| 40 | <p> |
| 41 | <b>Table of Contents</b> |
| 42 | </p> |
| 43 | <dl> |
| 44 | <dt> |
| 45 | <span class="sect1"> |
| 46 | <a href="admin.html#backup">Backing Up Berkeley DB SQL Databases</a> |
| 47 | </span> |
| 48 | </dt> |
| 49 | <dd> |
| 50 | <dl> |
| 51 | <dt> |
| 52 | <span class="sect2"> |
| 53 | <a href="admin.html#idp50739296">Backing Up Replicated Berkeley DB SQL Databases</a> |
| 54 | </span> |
| 55 | </dt> |
| 56 | </dl> |
| 57 | </dd> |
| 58 | <dt> |
| 59 | <span class="sect1"> |
| 60 | <a href="sync.html">Syncing with Oracle Databases</a> |
| 61 | </span> |
| 62 | </dt> |
| 63 | <dd> |
| 64 | <dl> |
| 65 | <dt> |
| 66 | <span class="sect2"> |
| 67 | <a href="sync.html#syncunix">Syncing on Unix Platforms</a> |
| 68 | </span> |
| 69 | </dt> |
| 70 | <dt> |
| 71 | <span class="sect2"> |
| 72 | <a href="sync.html#syncwin">Syncing on Windows Platforms</a> |
| 73 | </span> |
| 74 | </dt> |
| 75 | <dt> |
| 76 | <span class="sect2"> |
| 77 | <a href="sync.html#syncwinmobile">Syncing on Windows Mobile Platforms</a> |
| 78 | </span> |
| 79 | </dt> |
| 80 | </dl> |
| 81 | </dd> |
| 82 | <dt> |
| 83 | <span class="sect1"> |
| 84 | <a href="datamigration.html">Data Migration</a> |
| 85 | </span> |
| 86 | </dt> |
| 87 | <dd> |
| 88 | <dl> |
| 89 | <dt> |
| 90 | <span class="sect2"> |
| 91 | <a href="datamigration.html#shellmigrate">Migration Using the Shells</a> |
| 92 | </span> |
| 93 | </dt> |
| 94 | </dl> |
| 95 | </dd> |
| 96 | </dl> |
| 97 | </div> |
| 98 | <p> |
| 99 | This chapter provides administrative procedures that are unique |
| 100 | to the Berkeley DB SQL interface. |
| 101 | </p> |
| 102 | <div class="sect1" lang="en" xml:lang="en"> |
| 103 | <div class="titlepage"> |
| 104 | <div> |
| 105 | <div> |
| 106 | <h2 class="title" style="clear: both"><a id="backup"></a>Backing Up Berkeley DB SQL Databases</h2> |
| 107 | </div> |
| 108 | </div> |
| 109 | </div> |
| 110 | <div class="toc"> |
| 111 | <dl> |
| 112 | <dt> |
| 113 | <span class="sect2"> |
| 114 | <a href="admin.html#idp50739296">Backing Up Replicated Berkeley DB SQL Databases</a> |
| 115 | </span> |
| 116 | </dt> |
| 117 | </dl> |
| 118 | </div> |
| 119 | <p> |
| 120 | You can use the standard SQLite <code class="literal">.dump</code> |
| 121 | command to backup the data managed by the BDB SQL interface. |
| 122 | </p> |
| 123 | <p> |
| 124 | The BDB SQL interface supports the standard SQLite Online Backup API. |
| 125 | However, there is a small difference between the two interfaces. |
| 126 | In the BDB SQL interface, the value returned by the <code class="literal">sqlite3_backup_remaining</code> method |
| 127 | and the number of pages passed to the <code class="literal">sqlite3_backup_step</code> method, |
| 128 | are estimates of the number of pages to be copied and not exact values. |
| 129 | To be certain that the backup process is complete, |
| 130 | check if the <code class="literal">sqlite3_backup_step</code> method has returned <code class="literal">SQLITE_DONE</code>. |
| 131 | To learn how to use SQLite Online Backup API, see the official <a class="ulink" href="http://www.sqlite.org/backup.html" target="_top">SQLite |
| 132 | Documentation Page.</a> |
| 133 | </p> |
| 134 | <p> |
| 135 | If you are using replication, you will also need to copy the |
| 136 | file that contains the replication pragma information in order |
| 137 | to have a full backup. To do that copy the file named <code class="literal"> |
| 138 | pragma</code> from the database journal directory. |
| 139 | </p> |
| 140 | <div class="sect2" lang="en" xml:lang="en"> |
| 141 | <div class="titlepage"> |
| 142 | <div> |
| 143 | <div> |
| 144 | <h3 class="title"><a id="idp50739296"></a>Backing Up Replicated Berkeley DB SQL Databases</h3> |
| 145 | </div> |
| 146 | </div> |
| 147 | </div> |
| 148 | <p> |
| 149 | When BDB SQL interface databases are replicated the process for backing up |
| 150 | a regular database should be followed. The user must then copy |
| 151 | some additional files for the backup to be complete. |
| 152 | </p> |
| 153 | <p> |
| 154 | The additional files can be found in the journal directory of |
| 155 | the source database, and should be copied into the journal |
| 156 | directory of the backup copy. The journal directory is |
| 157 | automatically created when a Berkeley DB SQL interface database is created. |
| 158 | The journal directory is created in the same directory as the |
| 159 | database file, it has the name of the database file with a |
| 160 | <code class="literal">-journal</code> appendix. |
| 161 | </p> |
| 162 | <p> |
| 163 | The files that need to be copied into the backup journal directory are: |
| 164 | </p> |
| 165 | <div class="itemizedlist"> |
| 166 | <ul type="disc"> |
| 167 | <li> |
| 168 | <code class="literal">__db.rep.egen</code> |
| 169 | </li> |
| 170 | <li> |
| 171 | <code class="literal">__db.rep.gen</code> |
| 172 | </li> |
| 173 | <li> |
| 174 | <code class="literal">__db.rep.init</code> |
| 175 | </li> |
| 176 | <li> |
| 177 | <code class="literal">__db.rep.system</code> |
| 178 | </li> |
| 179 | </ul> |
| 180 | </div> |
| 181 | <p> |
| 182 | </p> |
| 183 | </div> |
| 184 | </div> |
| 185 | </div> |
| 186 | <div class="navfooter"> |
| 187 | <hr /> |
| 188 | <table width="100%" summary="Navigation footer"> |
| 189 | <tr> |
| 190 | <td width="40%" align="left"><a accesskey="p" href="rep_usageexamples.html">Prev</a> </td> |
| 191 | <td width="20%" align="center"> </td> |
| 192 | <td width="40%" align="right"> <a accesskey="n" href="sync.html">Next</a></td> |
| 193 | </tr> |
| 194 | <tr> |
| 195 | <td width="40%" align="left" valign="top">Replication Usage Examples </td> |
| 196 | <td width="20%" align="center"> |
| 197 | <a accesskey="h" href="index.html">Home</a> |
| 198 | </td> |
| 199 | <td width="40%" align="right" valign="top"> Syncing with Oracle Databases</td> |
| 200 | </tr> |
| 201 | </table> |
| 202 | </div> |
| 203 | </body> |
| 204 | </html> |