1.Dd December 3, 2003       \" DATE 
2.Dt db_recover 1       \" Program name and manual section number 
3.Os Darwin
4.Sh NAME                 \" Section Header - required - don't modify 
5.Nm db_recover
6.\" The following lines are read in generating the apropos(man -k) database. Use only key
7.\" words here as the database is built based on the words here and in the .ND line. 
8.\" Use .Nm macro to designate other names for the documented program.
9.Sh SYNOPSIS             \" Section Header - required - don't modify
10.Nm
11.Op Fl ceVv
12.Op Fl h Ar home 
13.Op Fl P Ar password
14.Op Fl t Ar [[CC]YY]MMDDhhmm[.SS]
15.Sh DESCRIPTION          \" Section Header - required - don't modify
16The
17.Nm
18utility must be run after an unexpected application, Berkeley DB, or system failure to restore the database to a consistent state. All committed transactions are guaranteed to appear after db_recover has run, and all uncommitted transactions will be completely undone.
19.Pp
20The options are as follows:
21.Bl -tag -width
22.It Fl c
23Perform catastrophic recovery instead of normal recovery.
24.It Fl e
25Retain the environment after running recovery. This option will rarely be used unless a DB_CONFIG file is present in the home directory. If a DB_CONFIG file is not present, then the regions will be created with default parameter values.
26.It Fl h
27Specify a home directory for the database environment; by default, the current working directory is used.
28.It Fl P
29Specify an environment password. Although Berkeley DB utilities overwrite password strings as soon as possible, be aware there may be a window of vulnerability on systems where unprivileged users can see command-line arguments or where utilities are not able to overwrite the memory containing the command-line arguments.
30.It Fl t
31Recover to the time specified rather than to the most current possible date. The timestamp argument should be in the form [[CC]YY]MMDDhhmm[.SS] where each pair of letters represents the following:
32.Bl -tag -width
33.It CC
34The first two digits of the year (the century).
35.It YY
36The second two digits of the year. If "YY" is specified, but "CC" is not, a value for "YY" between 69 and 99 results in a "YY" value of 19. Otherwise, a "YY" value of 20 is used.
37.It MM
38The month of the year, from 1 to 12.
39.It DD
40The day of the month, from 1 to 31.
41.It hh
42The hour of the day, from 0 to 23.
43.It mm
44The minute of the hour, from 0 to 59.
45.It SS
46The second of the minute, from 0 to 61.
47.El
48If the "CC" and "YY" letter pairs are not specified, the values default to the current year. If the "SS" letter pair is not specified, the value defaults to 0.
49.It Fl V
50Write the library version number to the standard output, and exit.
51.It Fl v
52Run in verbose mode.
53.El
54.Pp
55In the case of catastrophic recovery, an archival copy -- or snapshot -- of all database files must be restored along with all of the log files written since the database file snapshot was made. (If disk space is a problem, log files may be referenced by symbolic links). For further information on creating a database snapshot, see Archival Procedures. For further information on performing recovery, see Recovery Procedures.
56.Pp
57If the failure was not catastrophic, the files present on the system at the time of failure are sufficient to perform recovery.
58.Pp
59If log files are missing, db_recover will identify the missing log file(s) and fail, in which case the missing log files need to be restored and recovery performed again.
60.Pp
61The db_recover utility uses a Berkeley DB environment (as described for the -h option, the environment variable DB_HOME, or because the utility was run in a directory containing a Berkeley DB environment). In order to avoid environment corruption when using a Berkeley DB environment, db_recover should always be given the chance to detach from the environment and exit gracefully. To cause db_recover to release all environment resources and exit cleanly, send it an interrupt signal (SIGINT).
62.Pp
63The db_recover utility exits 0 on success, and >0 if an error occurs.
64.Pp
65.Sh ENVIRONMENT      \" May not be needed
66.Bl -tag -width "DB_HOME" \" ENV_VAR_1 is width of the string ENV_VAR_1
67.It Ev DB_HOME
68If the -h option is not specified and the environment variable DB_HOME is set, it is used as the path of the database home, as described in DB_ENV->open.
69.El                      
70.\" .Sh FILES                \" File used or created by the topic of the man page
71.\" .Bl -tag -width "/Users/joeuser/Library/really_long_file_name" -compact
72.\" .It Pa /usr/share/file_name
73.\" FILE_1description
74.\" .It Pa /Users/joeuser/Library/really_long_file_name
75.\" FILE_2 description
76.\" .Sh DIAGNOSTICS       \" May not be needed
77.\" .Bl -diag
78.\" .It Diagnostic Tag
79.\" Diagnostic informtion here.
80.\" .It Diagnostic Tag
81.\" Diagnostic informtion here.
82.\" .El
83.Sh SEE ALSO 
84.Xr db_archive 1 ,
85.Xr db_checkpoint 1 ,
86.Xr db_deadlock 1 ,
87.Xr db_dump 1 ,
88.Xr db_load 1 ,
89.Xr db_printlog 1 ,
90.Xr db_stat 1 ,
91.Xr db_upgrade 1 ,
92.Xr db_verify 1
93.\" .Sh BUGS              \" Document known, unremedied bugs 
94.\" .Sh HISTORY           \" Document history if command behaves in a unique manner 
95