Overview of the Database Recovery Process


Database recovery, in its simplest form, is the restoration of a database after its partial destruction due to some failure.

Note:

The term database recovery process is slightly misleading because the unit of granularity for recovery is the data set: usually only a single failed data set needs to be recovered. HALDBs and DEDBs take advantage of this characteristic by allowing continued access to the rest of the database while individual partitions or areas are recovered.


In order to facilitate this process, some forward planning needs to be done.

Periodically, a copy of the data in the database is saved. This copy is normally referred to as a backup copy or image copy. These image copies can reside on DASD or cartridges. Though this process can be done anytime, it is normally done when there is no other database activity. Image copies are complete copies of the database. There are other strategies for taking a database backup, but they will not be discussed in this book.

In addition to taking an image copy of the databases, you can log and save all changes made to the data in the database, at least until the next image copy. These changes are contained in data sets called log data sets. This provides a complete recovery environment so that no data is lost in the event of a system or application failure.

The recovery process for IMS databases can include these three basic steps, although the details of the process can vary with the type of database to be recovered:

1.

Restore the database to the most current image copy.

2.

Use the log data sets (or change accumulation data sets) to restore changes made to the database since the image copy was made.

3.

Back out any incomplete changes.

Figure 11-1 illustrates a simple database recovery.

Figure 11-1. IMS Database Recovery Process


As mentioned earlier in this book, DBRC can be used to help ensure that there is always a recovery process available. Using DBRC to control database backup and recovery is not mandatory but is highly recommended.

Related Reading: For more information about DBRC, see Chapter 23, "Database Recovery Control (DBRC) Facility," on page 375.

The following sections discuss other aspects of the recovery process:

  • "Online Programs and Recovery"

  • "DB Batch Update Programs and Recovery"

Online Programs and Recovery

IMS online transactions use dynamic backout to undo updates done in any incomplete unit of work. Online programs that abend are automatically backed out by the online system using the log records. In addition, if the system fails while an application program is active, any updates made by that program are automatically backed out when the system is restarted.

If the program was a BMP program, the updates are automatically backed out to its most recent checkpoint. Because of this automatic backout, the recovery of individual databases is not needed.

At IMS restart time, if the emergency restart cannot complete the backout for any individual transactions, then the databases affected by those updates are stopped, and DBRC is requested to set the recovery needed flag to ensure that a correct recovery is completed before the database is opened for more updates. In the case of dynamic backout failure, a batch backout or database recovery must be performed, depending on the reason for the backout failure.

DB Batch Update Programs and Recovery

DB batch update programs can make use of dynamic backout as do BMP programs, provided the following JCL changes are made:

  • The BKO=Y parameter is set in the EXEC statement

  • A DASD log data set is provided in the IEFRDER DD statement

  • A ROLB call is issued in the program code for non-system abends

The dynamic backout backs out the updates to the last checkpoint found on the log data set.



Introduction to IMS. Your Complete Guide to IBM's Information Management System
An Introduction to IMS: Your Complete Guide to IBMs Information Management System
ISBN: 0131856715
EAN: 2147483647
Year: 2003
Pages: 226

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net