osrecovr [options] [-f backup/log-file...] [pathname_translation...]
The osrecovr utility can restore backups as well as recover data from archive logs, both in the same invocation.
When you run the osrestore or osrecovr utility, the operation is transaction protected. This means that if the operation fails, ObjectStore rolls databases back to the state they were in before the operation started.
ObjectStore applications cannot access databases that are being restored until the entire restoration process has finished.
Specify a pathname_translation when you want to restore
For example, if you specify -c when you initiate osrecovr, ObjectStore recovers each snapshot in its own transaction. If the operation fails because of media failure while applying the last snapshot, ObjectStore rolls the databases back to the state they were in as of the last successfully applied snapshot.
However, suppose that each snapshot is 100 MB. This requires 100 MB of log space. If you ensure that the database does not exist when the recover operation starts, and if you apply all snapshots in a single transaction, all recovered data bypasses the log and goes directly to the database. Now if the operation fails, ObjectStore rolls all changes back, including the database creation.
The fundamental tradeoff is between the ability to roll back to a previous state and the resources needed to log the changes so that rollback is possible. In cases in which the size of the databases being recovered exceeds the size of the space available (or desirable) for logging, it is preferable
% osrecovr -f /vancouver1/archives/1999011216.aaa -t
Recovering from volume #1 (/vancouver1/archives/1999011216.aaa)... vancouver::/foo.db vancouver::/dbdir/bar.db vancouver::/dbdir/foo.db Closing volume #1 (/vancouver1/archives/1999011216.aaa). %
% osrecovr -f /vancouver1/archives/1999011216.aaa
Recovering from volume #1 (/vancouver1/archives/1999011216.aaa)... Target time: Tue Jan 12 17:28:22 1999 Recovered to time Tue Jan 12 16:25:27 1999 Recovered to time Tue Jan 12 16:25:57 1999 Recovered to time Tue Jan 12 16:26:11 1999 Restoring 452 sectors to database "vancouver:/vancouver1/dbdir/foo.db" Recovered to time Tue Jan 12 16:26:41 1999 Recovered to time Tue Jan 12 16:27:13 1999 Recovered to time Tue Jan 12 16:27:43 1999 Recovered to time Tue Jan 12 16:28:14 1999 Closing volume #1 (/vancouver1/archives/1999011216.aaa). %
% osrecovr -f /vancouver1/archives/1999011216.aaa -r 16:25:27
Recovering from volume #1 (/vancouver1/archives/1999011216.aaa)... Target time: Tue Jan 12 16:25:27 1999 Recovered to time Tue Jan 12 16:25:27 1999 Closing volume #1 (/vancouver1/archives/1999011216.aaa).
% cat ./archive_list
/vancouver1/archives/1999011216.aaa /vancouver1/archives/1999011216.aab /vancouver1/archives/1999011216.aac
% osrecovr -t -F ./archive_list
Recovering from volume #1 (/vancouver1/archives/1999011216.aaa)... vancouver::/foo.db vancouver::/dbdir/bar.db vancouver::/dbdir/foo.db Closing volume #1 (/vancouver1/archives/1999011216.aaa).
% osrecovr -F ./archive_list
Recovering from volume #1 (/vancouver1/archives/1999011216.aaa)... Target time: Tue Jan 12 17:27:01 1999 Recovered to time Tue Jan 12 16:25:27 1999 Recovered to time Tue Jan 12 16:25:57 1999 Recovered to time Tue Jan 12 16:26:11 1999 Restoring 452 sectors to database "vancouver:/vancouver1/dbdir/foo.db" Recovered to time Tue Jan 12 16:26:41 1999 Recovered to time Tue Jan 12 16:27:13 1999 Recovered to time Tue Jan 12 16:27:43 1999 Recovered to time Tue Jan 12 16:28:14 1999 Closing volume #1 (/vancouver1/archives/1999011216.aaa). Auto switching to volume #2 (/vancouver1/archives/1999011216.aab). Recovering from volume #2 (/vancouver1/archives/1999011216.aab)... Recovered to time Tue Jan 12 16:28:21 1999 Recovered to time Tue Jan 12 16:28:35 1999 Recovered to time Tue Jan 12 16:28:37 1999 Recovered to time Tue Jan 12 16:28:38 1999 Recovered to time Tue Jan 12 16:28:40 1999 Recovered to time Tue Jan 12 16:28:41 1999 Recovered to time Tue Jan 12 16:28:49 1999 Recovered to time Tue Jan 12 16:28:55 1999 Recovered to time Tue Jan 12 16:29:01 1999 Recovered to time Tue Jan 12 16:29:06 1999 Recovered to time Tue Jan 12 16:29:12 1999 Recovered to time Tue Jan 12 16:29:17 1999 Recovered to time Tue Jan 12 16:29:23 1999 Recovered to time Tue Jan 12 16:29:28 1999 Recovered to time Tue Jan 12 16:29:34 1999 Recovered to time Tue Jan 12 16:29:39 1999 Recovered to time Tue Jan 12 16:29:43 1999 Recovered to time Tue Jan 12 16:29:44 1999 Recovered to time Tue Jan 12 16:29:49 1999 Recovered to time Tue Jan 12 16:29:55 1999 Recovered to time Tue Jan 12 16:30:01 1999 Closing volume #2 (/vancouver1/archives/1999011216.aab). Auto switching to volume #3 (/vancouver1/archives/1999011216.aac). Recovering from volume #3 (/vancouver1/archives/1999011216.aac)... Recovered to time Tue Jan 12 16:31:04 1999 Recovered to time Tue Jan 12 16:31:06 1999 Closing volume #3 (/vancouver1/archives/1999011216.aac). %
% osrecovr -F ./archive_list -D 1/12/1999 -r 16:27:43
Recovering from volume #1 (/vancouver1/archives/1999011216.aaa)... Target time: Tue Jan 12 16:27:43 1999 Recovered to time Tue Jan 12 16:25:27 1999 Recovered to time Tue Jan 12 16:25:57 1999 Recovered to time Tue Jan 12 16:26:11 1999 Restoring 452 sectors to database "vancouver:/vancouver1/dbdir/foo.db"Recovered to time Tue Jan 12 16:26:41 1999 Recovered to time Tue Jan 12 16:27:13 1999 Recovered to time Tue Jan 12 16:27:43 1999 Closing volume #1 (/vancouver1/archives/1999011216.aaa). %
% osrecovr -F ./archive_list -r 16:27:43
Recovering from volume #1 (/vancouver1/archives/1999011216.aaa)... Target time: Tue Jan 12 16:27:43 1999 Recovered to time Tue Jan 12 16:25:27 1999 Recovered to time Tue Jan 12 16:25:57 1999 Recovered to time Tue Jan 12 16:26:11 1999 Restoring 452 sectors to database "vancouver:/vancouver1/dbdir/foo.db" Recovered to time Tue Jan 12 16:26:41 1999 Recovered to time Tue Jan 12 16:27:13 1999 Recovered to time Tue Jan 12 16:27:43 1999 Closing volume #1 (/vancouver1/archives/1999011216.aaa). %
% osrecovr -F ./archive_list -r 16:27:43 vancouver::/foo.db \
vancouver::/bar.db
Recovering from volume #1 (/vancouver1/archives/1999011216.aaa)... Target time: Tue Jan 12 16:27:43 1999 Recovered to time Tue Jan 12 16:25:27 1999 Recovered to time Tue Jan 12 16:25:57 1999 Recovered to time Tue Jan 12 16:26:11 1999 Recovered to time Tue Jan 12 16:26:41 1999 Recovered to time Tue Jan 12 16:27:13 1999 Recovered to time Tue Jan 12 16:27:43 1999 Closing volume #1 (/vancouver1/archives/1999011216.aaa).
% osls vancouver::/
bar.db dbdir/ foo.db %
% cat ./archive_list
/vancouver1/archives/1999011216.aaa /vancouver1/archives/1999011216.aab /vancouver1/archives/1999011216.aac
% osrecovr -t -F ./archive_list
Recovering from volume #1 (/vancouver1/archives/1999011216.aaa)... vancouver::/foo.db vancouver::/dbdir/bar.db vancouver::/dbdir/foo.db Closing volume #1 (/vancouver1/archives/1999011216.aaa). %
% osrecovr -f /vancouver1/archives/1999011216.aaa -r 16:25:27 \
vancouver::/asdla.db vancouver::/as.db
Recovering from volume #1 (/vancouver1/archives/1999011216.aaa)... Closing volume #1 (/vancouver1/archives/1999011216.aaa). Recover failed: Database vancouver::/asdla.db does not exist in this backup image %
% osrecovr -F ./archive_list -D 1/11
Recovering from volume #1 (/vancouver1/archives/1999011216.aaa)... Target time: Mon Jan 11 17:29:08 1999 Closing volume #1 (/vancouver1/archives/1999011216.aaa). %
% osrecovr -F ./archive_list -D 1/11/1998
Recovering from volume #1 (/vancouver1/archives/1999011216.aaa)... Target time: Sun Jan 11 17:29:51 1998 Closing volume #1 (/vancouver1/archives/1999011216.aaa). %
Updated: 03/11/99 11:19:07