1<!--$Id: db_recover.so,v 10.32 2007/10/26 15:02:55 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_recover</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_recover</b> 14</td> 15</tr></table> 16<hr size=1 noshade> 17<tt> 18<b><pre>db_recover [<b>-cefVv</b>] [<b>-h home</b>] [<b>-P password</b>] [<b>-t [[CC]YY]MMDDhhmm[.SS]]</b>]</pre></b> 19<b>Description</b> 20<a name="2"><!--meow--></a> 21<p>The db_recover utility must be run after an unexpected application, 22Berkeley DB, or system failure to restore the database to a consistent state. 23All committed transactions are guaranteed to appear after db_recover 24has run, and all uncommitted transactions will be completely undone.</p> 25<p>The options are as follows:</p> 26<br> 27<b>-c</b><ul compact><li>Perform catastrophic recovery instead of normal recovery.</ul> 28<b>-e</b><ul compact><li>Retain the environment after running recovery. This option 29will rarely be used unless a <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is present in the 30home directory. If a <a href="../ref/env/db_config.html#DB_CONFIG">DB_CONFIG</a> file is not present, then the 31regions will be created with default parameter values.</ul> 32<b>-f</b><ul compact><li>Display a message on the standard output showing the 33percent of recovery completed.</ul> 34<b>-h</b><ul compact><li>Specify a home directory for the database environment; by 35default, the current working directory is used.</ul> 36<b>-P</b><ul compact><li>Specify an environment password. Although Berkeley DB utilities overwrite 37password strings as soon as possible, be aware there may be a window of 38vulnerability on systems where unprivileged users can see command-line 39arguments or where utilities are not able to overwrite the memory 40containing the command-line arguments.</ul> 41<b>-t</b><ul compact><li>Recover to the time specified rather than to the most current possible 42date. The timestamp argument should be in the form 43[[CC]YY]MMDDhhmm[.SS] where each pair of 44letters represents the following:</ul> 45<br> 46<b>CC</b><ul compact><li>The first two digits of the year (the century).</ul> 47<b>YY</b><ul compact><li>The second two digits of the year. If "YY" is specified, but "CC" is not, 48a value for "YY" between 69 and 99 results in a "CC" value of 19. Otherwise, 49a "CC" value of 20 is used.</ul> 50<b>MM</b><ul compact><li>The month of the year, from 1 to 12.</ul> 51<b>DD</b><ul compact><li>The day of the month, from 1 to 31.</ul> 52<b>hh</b><ul compact><li>The hour of the day, from 0 to 23.</ul> 53<b>mm</b><ul compact><li>The minute of the hour, from 0 to 59.</ul> 54<b>SS</b><ul compact><li>The second of the minute, from 0 to 61.</ul> 55<br> 56<p>If the "CC" and "YY" letter pairs are not specified, the values default 57to the current year. If the "SS" letter pair is not specified, the value 58defaults to 0.</p> 59<b>-V</b><ul compact><li>Write the library version number to the standard output, and exit.</ul> 60<b>-v</b><ul compact><li>Run in verbose mode.</ul> 61<br> 62<p>In the case of catastrophic recovery, an archival copy -- or 63<i>snapshot</i> -- of all database files must be restored along with 64all of the log files written since the database file snapshot was made. 65(If disk space is a problem, log files may be referenced by symbolic 66links). For further information on creating a database snapshot, see 67<a href="../ref/transapp/archival.html">Archival Procedures</a>. For 68further information on performing recovery, see 69<a href="../ref/transapp/recovery.html">Recovery Procedures</a>.</p> 70<p>If the failure was not catastrophic, the files present on the system at the 71time of failure are sufficient to perform recovery.</p> 72<p>If log files are missing, db_recover will identify the missing 73log file(s) and fail, in which case the missing log files need to be 74restored and recovery performed again.</p> 75<p>The db_recover utility uses a Berkeley DB environment (as described for the 76<b>-h</b> option, the environment variable <b>DB_HOME</b>, or 77because the utility was run in a directory containing a Berkeley DB 78environment). In order to avoid environment corruption when using a 79Berkeley DB environment, db_recover should always be given the chance to 80detach from the environment and exit gracefully. To cause db_recover 81to release all environment resources and exit cleanly, send it an 82interrupt signal (SIGINT).</p> 83<p>The db_recover utility exits 0 on success, and >0 if an error occurs.</p> 84<br><b>Environment Variables</b> 85<br> 86<b>DB_HOME</b><ul compact><li>If the <b>-h</b> option is not specified and the environment variable 87DB_HOME is set, it is used as the path of the database home, as described 88in <a href="../api_c/env_open.html">DB_ENV->open</a>.</ul> 89<br> 90</tt> 91<p><font size=1>Copyright (c) 1996,2008 Oracle. All rights reserved.</font> 92</body> 93</html> 94