1<!--$Id: db_upgrade.so,v 1.10 2006/10/05 01:06:08 bostic Exp $--> 2<!--Copyright (c) 1997,2008 Oracle. All rights reserved.--> 3<!--See the file LICENSE for redistribution information.--> 4<html> 5<head> 6<title>Berkeley DB: db_upgrade</title> 7<meta name="description" content="Berkeley DB: An embedded database programmatic toolkit."> 8<meta name="keywords" content="embedded,database,programmatic,toolkit,btree,hash,hashing,transaction,transactions,locking,logging,access method,access methods,Java,C,C++"> 9</head> 10<body bgcolor=white> 11<table width="100%"><tr valign=top> 12<td> 13<b>db_upgrade</b> 14</td> 15</tr></table> 16<hr size=1 noshade> 17<tt> 18<b><pre>db_upgrade [<b>-NsVv</b>] [<b>-h home</b>] [<b>-P password</b>] file ...</pre></b> 19<b>Description</b> 20<a name="2"><!--meow--></a><a name="3"><!--meow--></a> 21<p>The db_upgrade utility upgrades the Berkeley DB version of one or more 22files and the databases they contain to the current release version.</p> 23<p>The options are as follows:</p> 24<br> 25<b>-h</b><ul compact><li>Specify a home directory for the database environment; by 26default, the current working directory is used.</ul> 27<b>-N</b><ul compact><li>Do not acquire shared region mutexes while running. Other problems, 28such as potentially fatal errors in Berkeley DB, will be ignored as well. 29This option is intended only for debugging errors, and should not be 30used under any other circumstances.</ul> 31<b>-P</b><ul compact><li>Specify an environment password. Although Berkeley DB utilities overwrite 32password strings as soon as possible, be aware there may be a window of 33vulnerability on systems where unprivileged users can see command-line 34arguments or where utilities are not able to overwrite the memory 35containing the command-line arguments.</ul> 36<b>-s</b><ul compact><li>This flag is only meaningful when upgrading databases from releases 37before the Berkeley DB 3.1 release. 38<p>As part of the upgrade from the Berkeley DB 3.0 release to the 3.1 release, 39the on-disk format of duplicate data items changed. To correctly upgrade 40the format requires that applications specify whether duplicate data 41items in the database are sorted or not. Specifying the <b>-s</b> 42flag means that the duplicates are sorted; otherwise, they are assumed 43to be unsorted. Incorrectly specifying the value of this flag may lead 44to database corruption.</p> 45<p>Because the db_upgrade utility upgrades a physical file 46(including all the databases it contains), it is not possible to use 47db_upgrade to upgrade files where some of the databases it 48includes have sorted duplicate data items, and some of the databases it 49includes have unsorted duplicate data items. If the file does not have 50more than a single database, if the databases do not support duplicate 51data items, or if all the databases that support duplicate data items 52support the same style of duplicates (either sorted or unsorted), 53db_upgrade will work correctly as long as the <b>-s</b> flag 54is correctly specified. Otherwise, the file cannot be upgraded using 55db_upgrade, and must be upgraded manually using the 56<a href="../utility/db_dump.html">db_dump</a> and <a href="../utility/db_load.html">db_load</a> utilities.</p></ul> 57<b>-V</b><ul compact><li>Write the library version number to the standard output, and exit.</ul> 58<b>-v</b><ul compact><li>Run in verbose mode, displaying a message for each successful upgrade.</ul> 59<br> 60<p><b>It is important to realize that Berkeley DB database upgrades are done 61in place, and so are potentially destructive.</b> This means that if the 62system crashes during the upgrade procedure, or if the upgrade procedure 63runs out of disk space, the databases may be left in an inconsistent and 64unrecoverable state. See <a href="../ref/am/upgrade.html">Upgrading 65databases</a> for more information.</p> 66<p>The db_upgrade utility may be used with a Berkeley DB environment (as described for the 67<b>-h</b> option, the environment variable <b>DB_HOME</b>, or 68because the utility was run in a directory containing a Berkeley DB 69environment). In order to avoid environment corruption when using a 70Berkeley DB environment, db_upgrade should always be given the chance to 71detach from the environment and exit gracefully. To cause db_upgrade 72to release all environment resources and exit cleanly, send it an 73interrupt signal (SIGINT).</p> 74<p>The db_upgrade utility exits 0 on success, and >0 if an error occurs.</p> 75<br><b>Environment Variables</b> 76<br> 77<b>DB_HOME</b><ul compact><li>If the <b>-h</b> option is not specified and the environment variable 78DB_HOME is set, it is used as the path of the database home, as described 79in <a href="../api_c/env_open.html">DB_ENV->open</a>.</ul> 80<br> 81</tt> 82<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 83</body> 84</html> 85