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_upgrade</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_stat.html" title="db_stat" /> 12 <link rel="next" href="db_verify.html" title="db_verify" /> 13 </head> 14 <body> 15 <div class="navheader"> 16 <table width="100%" summary="Navigation header"> 17 <tr> 18 <th colspan="3" align="center">db_upgrade</th> 19 </tr> 20 <tr> 21 <td width="20%" align="left"><a accesskey="p" href="db_stat.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_verify.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_upgrade"></a>db_upgrade</h2> 35 </div> 36 </div> 37 </div> 38 <pre class="programlisting">db_upgrade [-NsVv] [-h home] [-P password] file ... </pre> 39 <p> 40 The <span class="command"><strong>db_upgrade</strong></span> utility upgrades the Berkeley DB version of one or more 41 files and the databases they contain to the current release version. 42 </p> 43 <p> 44 The options are as follows: 45 </p> 46 <div class="itemizedlist"> 47 <ul type="disc"> 48 <li> 49 <p> 50 <span class="bold"><strong>-h</strong></span> 51 </p> 52 <p> 53 Specify a home directory for the database environment; by default, the 54 current working directory is used. 55 </p> 56 </li> 57 <li> 58 <p> 59 <span class="bold"><strong>-N</strong></span> 60 </p> 61 <p> 62 Do not acquire shared region mutexes while running. Other problems, 63 such as potentially fatal errors in Berkeley DB, will be ignored as 64 well. This option is intended only for debugging errors, and should 65 not be used under any other circumstances. 66 </p> 67 </li> 68 <li> 69 <p> 70 <span class="bold"><strong>-P</strong></span> 71 </p> 72 <p> 73 Specify an environment password. Although Berkeley DB utilities 74 overwrite password strings as soon as possible, be aware there may be 75 a window of vulnerability on systems where unprivileged users can see 76 command-line arguments or where utilities are not able to overwrite 77 the memory containing the command-line arguments. 78 </p> 79 </li> 80 <li> 81 <p> 82 <span class="bold"><strong>-s</strong></span> 83 </p> 84 <p> 85 This flag is only meaningful when upgrading databases from releases 86 before the Berkeley DB 3.1 release. 87 </p> 88 <p> 89 As part of the upgrade from the Berkeley DB 3.0 release to the 3.1 90 release, the on-disk format of duplicate data items changed. To 91 correctly upgrade the format requires that applications specify 92 whether duplicate data items in the database are sorted or not. 93 Specifying the <span class="bold"><strong>-s</strong></span> flag means that the 94 duplicates are sorted; otherwise, they are assumed to be unsorted. 95 Incorrectly specifying the value of this flag may lead to database 96 corruption. 97 </p> 98 <p> 99 Because the <span class="command"><strong>db_upgrade</strong></span> utility upgrades a physical file (including all 100 the databases it contains), it is not possible to use <span class="command"><strong>db_upgrade</strong></span> to 101 upgrade files where some of the databases it includes have sorted 102 duplicate data items, and some of the databases it includes have 103 unsorted duplicate data items. If the file does not have more than a 104 single database, if the databases do not support duplicate data items, 105 or if all the databases that support duplicate data items support the 106 same style of duplicates (either sorted or unsorted), <span class="command"><strong>db_upgrade</strong></span> will 107 work correctly as long as the <span class="bold"><strong>-s</strong></span> flag 108 is correctly specified. Otherwise, the file cannot be upgraded using 109 <span class="command"><strong>db_upgrade</strong></span>, and must be upgraded manually using the 110 <a class="xref" href="db_dump.html" title="db_dump">db_dump</a> and 111 <a class="xref" href="db_load.html" title="db_load">db_load</a> utilities. 112 </p> 113 </li> 114 <li> 115 <p> 116 <span class="bold"><strong>-V</strong></span> 117 </p> 118 <p> 119 Write the library version number to the standard output, and exit. 120 </p> 121 </li> 122 <li> 123 <p> 124 <span class="bold"><strong>-v</strong></span> 125 </p> 126 <p> 127 Run in verbose mode, displaying a message for each successful upgrade. 128 </p> 129 </li> 130 </ul> 131 </div> 132 <p> 133 <span class="bold"><strong>It is important to realize that Berkeley DB 134 database upgrades are done in place, and so are potentially 135 destructive.</strong></span> This means that if the system crashes during 136 the upgrade procedure, or if the upgrade procedure runs out of disk 137 space, the databases may be left in an inconsistent and unrecoverable 138 state. See <a href="../../programmer_reference/am_upgrade.html" class="olink">Upgrading databases</a> for more information. 139 </p> 140 <p> 141 The <span class="command"><strong>db_upgrade</strong></span> utility may be used with a Berkeley DB environment (as 142 described for the <span class="bold"><strong>-h</strong></span> option, the 143 environment variable <span class="bold"><strong>DB_HOME</strong></span>, or 144 because the utility was run in a directory containing a Berkeley DB 145 environment). In order to avoid environment corruption when using a 146 Berkeley DB environment, <span class="command"><strong>db_upgrade</strong></span> should always be given the chance 147 to detach from the environment and exit gracefully. To cause 148 <span class="command"><strong>db_upgrade</strong></span> to release all environment resources and exit cleanly, send 149 it an interrupt signal (SIGINT). 150 </p> 151 <p> 152 The <span class="command"><strong>db_upgrade</strong></span> utility exits 0 on success, and >0 if an error 153 occurs. 154 </p> 155 <div class="sect2" lang="en" xml:lang="en"> 156 <div class="titlepage"> 157 <div> 158 <div> 159 <h3 class="title"><a id="id1721912"></a>Environment Variables</h3> 160 </div> 161 </div> 162 </div> 163 <div class="sect3" lang="en" xml:lang="en"> 164 <div class="titlepage"> 165 <div> 166 <div> 167 <h4 class="title"><a id="id1721922"></a>DB_HOME</h4> 168 </div> 169 </div> 170 </div> 171 <p> 172 If the <span class="bold"><strong>-h</strong></span> option is not specified and 173 the environment variable DB_HOME is set, it is used as the path of the 174 database home, as described in the 175 <a class="xref" href="envopen.html" title="DbEnv::open()">DbEnv::open()</a> 176 method. 177 </p> 178 </div> 179 </div> 180 </div> 181 <div class="navfooter"> 182 <hr /> 183 <table width="100%" summary="Navigation footer"> 184 <tr> 185 <td width="40%" align="left"><a accesskey="p" href="db_stat.html">Prev</a> </td> 186 <td width="20%" align="center"> 187 <a accesskey="u" href="utilities.html">Up</a> 188 </td> 189 <td width="40%" align="right"> <a accesskey="n" href="db_verify.html">Next</a></td> 190 </tr> 191 <tr> 192 <td width="40%" align="left" valign="top">db_stat </td> 193 <td width="20%" align="center"> 194 <a accesskey="h" href="index.html">Home</a> 195 </td> 196 <td width="40%" align="right" valign="top"> db_verify</td> 197 </tr> 198 </table> 199 </div> 200 </body> 201</html> 202