In most cases, if a failure occurs during transition of either a source or target database, recovery will be performed and the databases will be returned to their original states (that is, as they existed before the transition was performed). In order to perform recovery, transition must perform a recovery backup immediately before the database is irreversibly changed. For example, during the transition of a target database, all live transactions must be rolled back. This is considered an irreversible change unless the database is backed up before the database change is performed.
The transition property recovery-backup-arguments allows you to specify the backup arguments used when transition performs its recovery backup. This property not only sets up the recovery backup arguments, it also instructs transition to perform a recovery backup. If this property is not specified, a transition will not perform a recovery backup. The recovery backup is performed immediately before the first irreversible operation is performed on the database.
Transition prepares as follows for a possible recovery before transitioning the database:
1. A new file named db-name.transition.recovery is created in the database directory. This file contains control and critical database information that must be saved in case a recovery is required.
2. If the recovery backup arguments are specified, transition performs a backup as follows:
If the database is a source, an offline backup of the database is performed before any additional operations are performed on the database. If the database is online at the time of transition, it is shut down before the backup is performed.
If the database is a target, an online backup is performed if the database is online; or an offline backup is performed if the database is offline. In both cases, the recovery backup is performed before any other transition operation is performed.
If an error occurs during the transition of a source database, the control and critical database information is overwritten with the information saved before transition began. The database should now be in the same state it was before transition was started, but it will be offline. Transition does not need to restore the recovery backup made.
If an error occurs during the transition of a target database, the following recovery actions are performed:
If the database has been irreversibly changed and a recovery backup was performed:
1. The current database log file, db-name.lg, is renamed db-name.lg.save.
2. The database is deleted.
3. The database is restored from the recovery backup. Ensure that you have the latest database structure file, db-name.st, in the database directory.
4. The saved database log, db-name.lg.save, is renamed db-name.lg.
5. The control and critical database information is overwritten with the information saved before transition began.
The database should now be in the same state it was before transition was started, but it will be offline.
If the database has been irreversibly changed and a recovery backup was not performed, the recovery process ends with an error indicating that it cannot continue with the database recovery.