Try OpenEdge Now
skip to main content
Database Administration
Protecting Your Data : Recovering a Database : Introduction to recovery mechanisms : Roll-forward recovery
 
Roll-forward recovery
Roll-forward recovery, used together with after-imaging and backup, lets you recover from media failures. When a database disk fails, you can restore the most recent backup, then use roll-forward recovery to restore the database to the condition it was in before you lost the disk. With roll-forward recovery, the database engine uses data in the AI files to automatically reprocess all the transactions that have been executed since the last backup was made.
To use roll-forward recovery, you must:
*Perform regularly scheduled backups of the database. Regular backups are a fundamental part of recovery.
*Enable after-imaging immediately after you complete the backup. See After-imaging for information about enabling after-imaging.
*Perform regularly scheduled backups of the AI files. See BackingUp a Databasefor information about backing up the AI files.
*Store the AI files on different disks than those containing the database and BI files.
When you enable after-imaging, the database engine writes database changes to the AI files. If you store the AI files on the same disks as the database or BI files and a disk is corrupted, you cannot use the AI files to recover that database.
*Archive the AI files to tape or other durable media as they become full.
This example shows how the database engine uses the AI files to restore the database. Suppose you run the following ABL procedure:
FOR EACH customer:
  UPDATE customer.name customer.max-credit.
END.
You update customers 1 and 2, and while you are updating customer 3, the disk where the database file is stored is damaged. You cannot use the BI file to restore the transactions because the original database is no longer valid.
However, because you enabled after-imaging, you can use roll-forward recovery to recover the database. If you do not enable after-imaging, you lose all the updates since the last database backup.
Before updating the database, the database engine makes a copy of the current information and writes it to the BI file and the AI file.
After updating customers 1 and 2, the database disk fails while updating customer 3. The AI files have a copy of all transactions completed since the last backup. Restore the last backup of the database and then roll forward the AI files to produce a restored database that contains all completed transactions.