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