In roll-forward recovery the log archival mode ensures that all old log files are available. The log files are available only from the time that the log archival mode is enabled.
You cannot use roll-forward recovery to restore individual tables. Roll-forward recovery recovers the entire database.
To restore a database by using roll-forward recovery, you must already have a backup copy of the database, all the archived logs since the backup was created, and the active log files. All the log files should be in the database log directory.
There are two types of log files in
Enabling log archival mode
Online archive logs are available only if the database is enabled for log archival mode. You can use the following system procedure to enable the database for log archival mode:
The input parameters for the calls in the previous example specify the
location where the backup should be stored and specify whether or not the
database should keep online archived logs for the backup. Existing online
archived log files that were created before this backup will be deleted if
the input parameter value for the deleteOnlineArchivedLogFiles parameter
is non-zero. The log files are deleted only after a successful backup.
Disabling log archival mode:
After you enable log archival mode, the database will always have the log archival mode enabled even if it is subsequently booted or backed up. The only way to disable the log archive mode is to run the following procedure:
This system procedure disables the log archive mode and deletes any existing online archived log files if the input parameter DELETE_ARCHIVED_LOG_FILES is non-zero.
Performing roll-forward recovery:
By using the full backup copy, archived logs, and active logs, you can restore a database to its most recent state by performing roll-forward recovery. You perform a roll-forward recovery by specifying a connection URL attribute rollForwardRecoveryFrom=<BackupPath> at boot time. This brings the database to its most recent state by using full backup copy, archived logs, and active logs. All the log files should be in the database log path directory.
Backing up a database:
In the following example, a database named wombat is backed up to the d:/backup
directory with log archive mode enabled:
Restoring a database using roll-forward recovery:
In the following example, the database is restored using roll-forward recovery
after a media failure:
The following attribute can be specified in the JDBC boot time connection URL:
rollForwardRecoveryFrom=<Path>
For more information, see the rollForwardRecoveryFrom=<Path> section
in the
After a database is restored from full backup, transactions from the online archived logs and active logs are replayed.