| 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_checkpoint</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="utilities.html" title="Appendix A. Berkeley DB Command Line Utilities" /> |
| 11 | <link rel="prev" href="db_archive.html" title="db_archive" /> |
| 12 | <link rel="next" href="db_deadlock.html" title="db_deadlock" /> |
| 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_checkpoint</th> |
| 22 | </tr> |
| 23 | <tr> |
| 24 | <td width="20%" align="left"><a accesskey="p" href="db_archive.html">Prev</a> </td> |
| 25 | <th width="60%" align="center">Appendix A. |
| 26 | Berkeley DB Command Line Utilities |
| 27 | </th> |
| 28 | <td width="20%" align="right"> <a accesskey="n" href="db_deadlock.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="db_checkpoint"></a>db_checkpoint</h2> |
| 38 | </div> |
| 39 | </div> |
| 40 | </div> |
| 41 | <pre class="programlisting">db_checkpoint [-1Vv] [-h home] |
| 42 | [-k kbytes] [-L file] [-P password] [-p min] </pre> |
| 43 | <p> |
| 44 | The <span class="command"><strong>db_checkpoint</strong></span> utility is a daemon process that monitors the |
| 45 | database log, and periodically calls |
| 46 | <a class="xref" href="txncheckpoint.html" title="DB_ENV->txn_checkpoint()">DB_ENV->txn_checkpoint()</a> |
| 47 | to checkpoint it. |
| 48 | </p> |
| 49 | <p> |
| 50 | The options are as follows: |
| 51 | </p> |
| 52 | <div class="itemizedlist"> |
| 53 | <ul type="disc"> |
| 54 | <li> |
| 55 | <p> |
| 56 | <span class="bold"><strong>-1</strong></span> |
| 57 | </p> |
| 58 | <p> |
| 59 | Force a single checkpoint of the log (regardless of whether or not |
| 60 | there has been activity since the last checkpoint), and then exit. |
| 61 | </p> |
| 62 | <p> |
| 63 | When the <span class="bold"><strong>-1</strong></span> flag is specified, the |
| 64 | <span class="command"><strong>db_checkpoint</strong></span> utility will checkpoint the log even if unable to find |
| 65 | an existing database environment. This functionality is useful when |
| 66 | upgrading database environments from one version of Berkeley DB to |
| 67 | another. |
| 68 | </p> |
| 69 | </li> |
| 70 | <li> |
| 71 | <p> |
| 72 | <span class="bold"><strong>-h</strong></span> |
| 73 | </p> |
| 74 | <p> |
| 75 | Specify a home directory for the database environment; by default, the |
| 76 | current working directory is used. |
| 77 | </p> |
| 78 | </li> |
| 79 | <li> |
| 80 | <p> |
| 81 | <span class="bold"><strong>-k</strong></span> |
| 82 | </p> |
| 83 | <p> |
| 84 | Checkpoint the database at least as often as every <span class="bold"><strong>kbytes</strong></span> of log file are written. |
| 85 | </p> |
| 86 | </li> |
| 87 | <li> |
| 88 | <p> |
| 89 | <span class="bold"><strong>-L</strong></span> |
| 90 | </p> |
| 91 | <p> |
| 92 | Log the execution of the <span class="command"><strong>db_checkpoint</strong></span> utility to the specified file |
| 93 | in the following format, where <span class="emphasis"><em>###</em></span> is the process |
| 94 | ID, and the date is the time the utility was started. |
| 95 | </p> |
| 96 | <pre class="programlisting"> db_checkpoint: ### Wed Jun 15 01:23:45 EDT 1995 </pre> |
| 97 | <p> |
| 98 | This file will be removed if the <span class="command"><strong>db_checkpoint</strong></span> |
| 99 | utility exits gracefully. |
| 100 | </p> |
| 101 | </li> |
| 102 | <li> |
| 103 | <p> |
| 104 | <span class="bold"><strong>-P</strong></span> |
| 105 | </p> |
| 106 | <p> |
| 107 | Specify an environment password. Although Berkeley DB utilities overwrite password |
| 108 | strings as soon as possible, be aware there may be a window of vulnerability on |
| 109 | systems where unprivileged users can see command-line arguments or where utilities |
| 110 | are not able to overwrite the memory containing the command-line arguments. |
| 111 | </p> |
| 112 | </li> |
| 113 | <li> |
| 114 | <p> |
| 115 | <span class="bold"><strong>-p</strong></span> |
| 116 | </p> |
| 117 | <p> |
| 118 | Checkpoint the database at least every <span class="bold"><strong>min</strong></span> minutes |
| 119 | if there has been any activity since the last checkpoint. |
| 120 | </p> |
| 121 | </li> |
| 122 | <li> |
| 123 | <p> |
| 124 | <span class="bold"><strong>-V</strong></span> |
| 125 | </p> |
| 126 | <p> |
| 127 | Write the library version number to the standard output, and exit. |
| 128 | </p> |
| 129 | </li> |
| 130 | <li> |
| 131 | <p> |
| 132 | <span class="bold"><strong>-v</strong></span> |
| 133 | </p> |
| 134 | <p> |
| 135 | Write the time of each checkpoint attempt to the standard output. |
| 136 | </p> |
| 137 | </li> |
| 138 | </ul> |
| 139 | </div> |
| 140 | <p> |
| 141 | At least one of the <span class="bold"><strong>-1</strong></span>, <span class="bold"><strong>-k</strong></span>, and <span class="bold"><strong>-p</strong></span> |
| 142 | options must be specified. |
| 143 | </p> |
| 144 | <p> |
| 145 | The <span class="command"><strong>db_checkpoint</strong></span> utility uses a Berkeley DB |
| 146 | environment (as described for the <span class="bold"><strong>-h</strong></span> |
| 147 | option, the environment variable |
| 148 | <span class="bold"><strong>DB_HOME</strong></span>, or because the utility |
| 149 | was run in a directory containing a Berkeley DB |
| 150 | environment). |
| 151 | In order to avoid environment corruption when using a Berkeley DB |
| 152 | environment, <span class="command"><strong>db_checkpoint</strong></span> should always be given the chance to detach |
| 153 | from the environment and exit gracefully. To cause <span class="command"><strong>db_checkpoint</strong></span> to |
| 154 | release all environment resources and exit cleanly, send it an |
| 155 | interrupt signal (SIGINT). |
| 156 | </p> |
| 157 | <p> |
| 158 | The <span class="command"><strong>db_checkpoint</strong></span> utility does not attempt to create the Berkeley DB |
| 159 | shared memory regions if they do not already exist. The application |
| 160 | that creates the region should be started first, and once the region |
| 161 | is created, the <span class="command"><strong>db_checkpoint</strong></span> utility should be started. |
| 162 | </p> |
| 163 | <p> |
| 164 | The <a class="xref" href="txncheckpoint.html" title="DB_ENV->txn_checkpoint()">DB_ENV->txn_checkpoint()</a> |
| 165 | method is the underlying method used by the <span class="command"><strong>db_checkpoint</strong></span> utility. See |
| 166 | the <span class="command"><strong>db_checkpoint</strong></span> utility source code for an example of using |
| 167 | <code class="methodname">DB_ENV->txn_checkpoint()</code> in a IEEE/ANSI Std 1003.1 (POSIX) environment. |
| 168 | </p> |
| 169 | <p> |
| 170 | The <span class="command"><strong>db_checkpoint</strong></span> utility exits 0 on success, and >0 if an error |
| 171 | occurs. |
| 172 | </p> |
| 173 | <div class="sect2" lang="en" xml:lang="en"> |
| 174 | <div class="titlepage"> |
| 175 | <div> |
| 176 | <div> |
| 177 | <h3 class="title"><a id="idp55074952"></a>Environment Variables</h3> |
| 178 | </div> |
| 179 | </div> |
| 180 | </div> |
| 181 | <div class="sect3" lang="en" xml:lang="en"> |
| 182 | <div class="titlepage"> |
| 183 | <div> |
| 184 | <div> |
| 185 | <h4 class="title"><a id="idp55075264"></a>DB_HOME</h4> |
| 186 | </div> |
| 187 | </div> |
| 188 | </div> |
| 189 | <p> |
| 190 | If the <span class="bold"><strong>-h</strong></span> option is not specified and |
| 191 | the environment variable DB_HOME is set, it is used as the path of the |
| 192 | database home, as described in the |
| 193 | <a class="xref" href="envopen.html" title="DB_ENV->open()">DB_ENV->open()</a> method. |
| 194 | </p> |
| 195 | </div> |
| 196 | </div> |
| 197 | </div> |
| 198 | <div class="navfooter"> |
| 199 | <hr /> |
| 200 | <table width="100%" summary="Navigation footer"> |
| 201 | <tr> |
| 202 | <td width="40%" align="left"><a accesskey="p" href="db_archive.html">Prev</a> </td> |
| 203 | <td width="20%" align="center"> |
| 204 | <a accesskey="u" href="utilities.html">Up</a> |
| 205 | </td> |
| 206 | <td width="40%" align="right"> <a accesskey="n" href="db_deadlock.html">Next</a></td> |
| 207 | </tr> |
| 208 | <tr> |
| 209 | <td width="40%" align="left" valign="top">db_archive </td> |
| 210 | <td width="20%" align="center"> |
| 211 | <a accesskey="h" href="index.html">Home</a> |
| 212 | </td> |
| 213 | <td width="40%" align="right" valign="top"> db_deadlock</td> |
| 214 | </tr> |
| 215 | </table> |
| 216 | </div> |
| 217 | </body> |
| 218 | </html> |