Restoring a Databank
Restoring a databank after it has been damaged or destroyed will typically involve both the host file system and SQL statements.
Note: Data need not be restored in the event of a power failure or system shut-down that does not damage the databank files, since any transactions that were committed but not completed at the time of the failure are automatically completed when the databank involved is next accessed.
Any databank restore operation must start with a backup copy of the databank file that is not damaged or corrupt. This is generally the copy taken during the last backup, either taken by the host operating system or by using the SQL system management statements for online backup.
Usually, the host file system is used to copy the backup file from the backup media to disk. The file is generally placed in the normal location for the databank file (as recorded in the data dictionary, SYSDB). However, in certain circumstances it may be necessary to place it in an alternative location, e.g. if the disk is unavailable.
The procedure for restoring a databank is as follows:
Note: Step 2 and 3 are only required during certain circumstances:
- Bring a valid backup copy of the databank from the backup media to disk.
- If the file has been placed in a location that is different to the location of the original databank file, alter the databank to reference the new file location using the following command:SQL> ALTER DATABANK databank-name
- If restoring from an older backup, i.e. not the latest one, information should be restored from the LOGDB included in the following backup (that was taken after the time the backup restored in step 1 was taken).
For each LOGDB backup file, the information recorded in it should be applied to the databank using the following command:SQL> ALTER DATABANK databank-name
RESTORE USING 'logdb-backup-file-name'
- Finally, apply the updates made since the most recent backup(s) restored in the preceding steps were taken. These updates are currently recorded in LOGDB and they are restored using the following command:SQL> ALTER DATABANK databank-name
RESTORE USING LOG
Mimer Information Technology AB
Voice: +46 18 780 92 00
Fax: +46 18 780 92 40