Administration Tools - oorestore

Printer-friendly version
Restores a federated database previously archived using oobackup.
oorestore
([-time timeOfRestore] [-source backupDir])
| (-set setName -backup backupName -volume volName
-device deviceSpecifier)
[-quiet]
[-exists ask | delete | quit]
[-procfilesbef befProgName]
[-procfilesaft aftProgName]
[[-newhost targetHost] -newdirectory targetDir [-failonly]
| -dbmap mapFile ]
[-dumpcatalog]
[-purgeAps]
[-standalone]
[-notitle]
[-help]
[backupBootFilePath]
Options
-time timeOfRestore
Time of the backup from which the federated database is to be restored. The default is the current time, which causes the most recent backup contained in backupDir to be restored.
If no backup in backupDir corresponds exactly to timeOfRestore, oorestore selects the latest backup in backupDir that was started prior to the specified time. If the selected backup is incremental, oorestore restores both the selected backup and the full backup on which it is based. Similarly, if the selected backup is subincremental, oorestore restores the selected backup along with the incremental and full backups on which it is based.
You specify timeOfRestore as an integer YYYYMMDDHHmm containing up to 12 digits representing component times as follows:
YYYY Year
MM Month of the year (01 to 12). For example, 02 is February.
DD Day of the month (01 to 31).
HH Hour of the day (00 to 23). For example, 00 is 12:00 midnight,
01 is 1:00 A.M., 13 is 1:00 P.M., and 23 is 11:00 P.M.
mm Minute of the hour (00 to 59)
Do not insert spaces or delimiters between the component digits. You can truncate digits (or specify 0’s) from right to left, to omit any irrelevant (or unspecified) detail. For example:
200105 Specifies 12:00 A.M. on May 1, 2001. You could use this timeOfRestore to select the most recent backup in backupDir that was started before May 2001.
20010515 Specifies 12:00 A.M. on May 15, 2001. You could use this timeOfRestore to select the most recent backup in backupDir that was started before May 15, 2001.
This option may be used with the -source option.
-source backupDir
Full path to the disk directory containing the files for the backup to be restored. The default is to search the current directory (the directory in which you are executing oorestore) for the backup to be restored.
This option may be used with the -time option.
-set setName
Name of the backup set containing the backup event representing the point of restore. This option must be used with the -backup, -volume, and -device options.
-backup backupName
Name of the backup event representing the point of restore. This option must be used with the -set, -volume, and -device options.
-volume volName
Volume name prefix of the backup volumes containing the data to be restored. This option must be used with the -set, -backup, and -device options.
-device deviceSpecifier
Full path to the disk directory containing the backup volumes to be restored. For example, if the value for deviceSpecifier is /dba/backups and the value for volName is fdb020492, then the actual disk filename for the first backup volume is /dba/backups/fdb020492_1.
This option must be used with the -set, -backup, and -volume options.
-quiet
Suppresses all normal program output.
-exists ask | delete | quit
Action to take if a file already exists with the same name and in the same location as a data file being restored.
ask Prompts whether to overwrite the existing file. If the answer is No, the program terminates. No is the default.
delete Overwrites the existing file.
quit Terminates if the file already exists.
The default value is ask.
-procfilesbef befProgName
Executes the shell script or program befProgName before each backup volume is opened for read access by oorestore. befProgName can contain a full or relative path. The name of the volume to be read is passed to the script as a command-line argument. If befProgName exits with a nonzero status, oorestore reports an error and terminates immediately.
-procfilesaft aftProgName
Executes the shell script or program aftProgName after oorestore finishes reading each backup volume. aftProgName can contain a full or relative path. If aftProgName exits with a nonzero status, oorestore reports an error and terminates immediately.
-newhost targetHost
Restores files to the new host targetHost, except for the backup boot file, which is restored to the host on which you are running this tool. The journal-directory property of the federated database or every autonomous partition is set to targetHost.
-newdirectory targetDir
Restores files to the new directory targetDir, except for the backup boot file, which is restored to the current working directory. The journal-directory property of the federated database and every autonomous partition is also set to targetDir (as a separate operation, you should reset each property to an appropriate unique directory).
If targetHost designates a remote system, targetDir must be full, not relative. targetDir must already exist (oorestore will not create it).
-failonly
Restores files to the location specified by -newhost and -newdirectory only if the files’ original locations are inaccessible. (However, the backup boot file is always restored to the current working directory, even if its original location is accessible.)
-dbmap mapFile
ASCII text mapping file that specifies the destination hosts and directories in which to restore individual data files and boot files. The mapping files also allows you to specify journal-directory properties for the restored federated database and (HA) any restored autonomous partitions. You cannot use this option with the -newhost, -newdirectory, or -failonly option.
The mapping file must be local to the directory in which oorestore is running. The mapping file must contain one line for each item to be remapped. (Any file not specified in the mapping file is restored to its original location; the backup boot file is always restored to the current working directory.)
Each line has the format:
keyword systemName targetHost targetPath
where
keyword Kind of file or directory to be remapped; either:
FD—federated-database system-database file
FDJNL—federated-database journal directory
DB—database file
AP—autonomous-partition system-database file
APBOOT—autonomous-partition boot file
APJNL—autonomous-partition journal directory
systemName System name of a federated database, database, or autonomous partition.
targetHost Host of the restored file or directory.
targetPath Path to the restored file or directory. The directory portion of the path must exist (oorestore does not create new directories).
Note: A mapping file currently cannot specify explicit destination locations for container files. However, specifying a destination location for a database file causes the database file and any related container files to be restored to that location.
-dumpcatalog
Displays catalog information from the federated database at the specified point of restore. This information includes the system names of storage objects, original file locations, and original journal-directory properties.
The system-database files for the federation and any partitions are temporarily restored to the current working directory and then deleted. You are prompted if the temporary files will overwrite any files already there.
Warning: Do not run oorestore with this option in a directory that already contains any system-database files.
oorestore always runs in standalone mode when this option is used since no usable federated database is generated.
-purgeAps
(HA) Restores the backup as an unpartitioned federated database (that is, a federated database that has only a single implicit autonomous partition).
Specifying this option restores the boot partition, its system-database file, and one image of each database in it. An image is also created for each database that did not previously have an image in the boot partition; such images are created in the default directory and have default constructed filenames. Partitions other than the boot partition are purged from the global catalog, and their system-database files are not restored.
You must specify this option if you are restoring the federated database to a single new location—for example, because you are restoring into a different environment that doesn’t have the same set of hosts, or into the original environment when some of the hosts are not accessible. After the restore is complete, you can re-create partitions and distribute or replicate databases as desired.
(For backward compatibility only) You must specify this option if you are restoring a pre-Release 9.0 federated database, and you specified the corresponding -purgeAps option on oobackup when you took the backup.
-standalone
Nonconcurrent mode. Use this option if no lock server is running or to bypass a running lock server. (HA) You can use this option when restoring a partitioned federated database only if you also specify the -purgeAps option.
Warning: Corruption can occur if concurrent access to the federated database is attempted while any process is using this mode.
-notitle
Suppresses the copyright notice and program title banner. Useful when invoking the tool from another tool or product.
-help
Prints the tool syntax and definition to the screen.
backupBootFilePath
Path identifying the federated database to be restored from the specified backup. You can omit this argument if you set the OO_FD_BOOT environment variable to the path.
This argument must match the backupBootFilePath that was specified to oobackup when the backup was created. As an argument to oorestore, backupBootFilePath is simply compared to a string saved in the backup, and need not resolve to an existing file (typically because the backup boot file no longer exists in its original location or because you are running oorestore in a different directory than oobackup). As long as the necessary backup volumes are accessible and undamaged, the condition of the boot file or the boot-file host does not affect the restore.
Discussion
When restoring a basic backup (a backup taken with options such as -full, -incremental, -subincremental, or -destination), you must perform a basic restore. To do so, you simply specify a point of restore (-time) and the directory containing the backup to be restored (-source). If you omit these options, the most recent backup in the current directory is restored.
When restoring a customized backup (a backup taken with the options -set, -backup, -device, and -volume), you must perform a customized restore. To do so, you must specify the backup set name (-set), the backup event name (-backup), the volume name (-volume), and the full directory path (-device) of the backup event representing the point of restore.
Unless you specify otherwise, oorestore restores files to their original locations. If the original locations are not accessible, you can restore files to a single location by specifying the -newhost and -newdirectory options, or you can restore files to multiple locations by specifying the -dbmap option with a mapping file. If files are restored to one or more nonoriginal locations, oorestore automatically adjusts all journal-directory properties as specified; if you have multiple autonomous partitions, you should reset each journal-directory property to a unique directory. Journal files themselves are not restored.
In all cases, the backup boot file is restored to the current working directory (the directory in which you run the tool). If a file with the same name as the backup boot file already exists in the current working directory, oorestore behaves as follows:
n
When restoring data files to their original locations (the default) or to multiple mapped locations (with -dbmap), oorestore reports an error and quits.
n
When restoring data files to a single location (with -newdirectory), oorestore prompts you to confirm whether to overwrite the backup boot file or quit.
This behavior safeguards your current backup boot file from the possibility of being accidentally overwritten by a restored version of the file. (Note, however, that specifying -exists delete causes the backup boot file to be overwritten without a prompt.)
Restoring a federated database automatically consolidates fragmented space, so the restored files may be significantly smaller than the original files.
See also

Date: 
Tuesday, October 30, 2012
Product: 
Objectivity/DB
Version: 
10.2.1
10.2
10.1.4
10.1.2
9.4.1