IAM/RLS Data Recovery
Recovery Overview
One of the most important considerations when implementing IAM/RLS, or any type of data sharing, is how to recover should errors, media failures, or outages occur. The journaling and recovery tools provided with IAM will assist in the recovery of data for the IAM files that are processed under IAM/RLS. The intent of the information presented in this section is to assist you in planning for your data recovery needs, and to help make sure that appropriate procedures are put in place for the protection of your data.
This section will address performing backout recoveries for failing batch jobs, and forward recoveries from restored IAM data sets. CICS provides the recovery for failed transactions with dynamic transaction backouts so IAM/RLS does not provide that capability.
IAM/RLS Journals
In order to perform recoveries with the IAM tools, you must provide for IAM/RLS Journaling, as described in IAM-RLS-Journaling. You will need to decide on what type of recoveries you will want to perform. If you want to be able to backout updates from failing job steps, you will need to specify the journaling of before images. If you want to be able to recover files after restoring them from a backup, you will need to be collecting the after images. To provide the best possible recoverability, we recommend that you journal both before and after images. This way, you will be able to perform whatever recoveries may be necessary. To make sure that journaling is being performed for all of your files, it is recommended that you provide the appropriate ACCESS overrides to the IAM/RLS address space that will specify the level of journaling you need. For example, to specify journaling for all data sets, you can use the following IAM override control card for the IAM/RLS proc:
ACCESS DD=&ALLDD,JRNAD=BOTH
If you have other override cards, be sure to specify the JRNAD=BOTH on those as well, as the DD=&ALLDD override card is effective only for data sets that are not otherwise explicitly specified on override control cards.
Managing the IAM/RLS Journals
When allocating the journal data sets for IAM/RLS, it is recommended that you provide space for at least 24 hours of processing. Providing that amount of journal space across four to six journal data sets will provide the capability for performing backout recoveries within a 24-hour period without having to research what journal data sets need to be used. We also recommend the use of the provided program, IAMJUTIL, with the REUSE option to copy the data from the active journal files to an accumulation data set. This will keep the journal data within each IAM journal data set until it is needed for reuse. Also, be sure to provide an automated mechanism to offload journal data from the IAM/RLS journal data sets, to make sure that there it will be ready when needed. This can be accomplished with the IAM/RLS JRNPROC= parameter, or by using automated operations software that looks for the message that an IAM journal file has been filled, and is being switched to the next journal file.
If you have sufficient DASD space, one method to handle the accumulation of the journal data is to have the procedure that offloads data from an IAM/RLS journal to place that data in a staging data set. If you have adequately sized journals, it will only be necessary to copy those journal records necessary for a forward recovery (that is, the after images). Each time an IAM/RLS journal is filled, the data from the most recently filled journal is added to the end of the staging data set. Then, on a scheduled periodic basis, such as daily, copy the data from the staging data set, and put it out to a GDG on tape, then clear out the staging data set. An example of what your offload proc might look like is shown below:
Example of IAM/RLS Journal Offload to Accumulation Data Set (EX2070A)
//****************************************************
//*
//* COPY AFTER IMAGES FROM AN IAM/RLS JOURNAL
//* TO AN ACCUMULATION DATA SET.
//* MARK JOURNAL AS ELGIBLE FOR REUSE
//*
//****************************************************
//OFFLOAD EXEC PGM=IAMJUTIL,REGION=6M
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//IAMJRNL DD DISP=SHR,DSN=&LOG
//JRNLOUT DD DISP=MOD,DSN=PROD.IAM/RLS.JOURNAL.ACCUM
//SYSOUT DD SYSOUT=*
//SYSIN DD DISP=SHR,DSN=IAMSYS.RLS.PARMLIB(OFFLOAD)
Contents of IAMSYS.RLS.PARMLIB(OFFLOAD):
COPY AFTER,REUSE
The job to copy the data from the accumulation file to tape can use either IAMJUTIL or IEBGENER. If you want, keep the before images in the accumulation data set, and only copy the after images to tape you would want to use IAMJUTIL. An example is shown below:
Example of copying journal data to GDG on tape (EX2070B)
//*
//* COPY AFTER IMAGES FROM AN IAM/RLS JOURNAL
//* ACCUMULATION DATASET TO A GDG ON TAPE.
//*THEN EMPTY THE ACUMMULATION DATASET.
//*
//****************************************************
//COPYACUM EXEC PGM=IAMJUTIL,REGION=6M
//SYSUDUMP DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//IAMJRNL DD DISP=OLD,DSN=PROD.IAM/RLS.JOURNAL.ACCUM
//JRNLOUT DD DISP=(NEW,CATLG),DSN=PROD.IAM/RLS.DATA(+1),
// UNIT=TAPE
//SYSOUT DD SYSOUT=*
//SYSIN DD *
COPY AFTER
/*
//MPTYACUM EXEC PGM=IEBGENER
//SYSUT2 DD DISP=OLD,DSN=PROD.IAM/RLS.JOURNAL.ACCUM
//SYSUT1 DD DUMMY,DCB=PROD.IAM/RLS.JOURNAL.ACCUM
//SYSPRINT DD DUMMY
//SYSIN DD DUMMY
Dynamic Job Backout
IAM/RLS offers an optional capability to dynamically backout changes made to IAM/RLS files that were made by an abending job step. The use of Dynamic Job Backout is controlled by the IAM/RLS parameter DJB, as discussed in IAM/RLS parameters. When a job step that has updated IAM files managed by IAM/RLS abends, if Dynamic Job Backout can be used by that job, then IAM/RLS will internally schedule the backout. The backout will be performed under the IAM/RLS address space, with appropriate messages issued upon completion. Upon completion of the backout, IAM/RLS will release any record locks retained by the failing job step. If the abending job step had taken any IAM batch syncpoints, then the backout will be performed to the last syncpoint taken by the job step. If no syncpoints are found, then all updates made to IAM files managed by IAM/RLS will be backed out.
Manual Job Backout
If you have not enabled Dynamic Job Backout, and a batch job step abends, you can use IAMJREST to perform backout of the failing job step. You would not normally want to perform a backout of the updates made by the preceding job steps because those record locks would have been released upon normal step termination, and those records could have subsequently been updated by another batch job or online system. An example of manual job backout is shown below. IAMJREST will automatically release any retained locks upon completion of the backout.
Example of JCL for manual backout (EX2070C)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//IAMINFO DD SYSOUT=*
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,10))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,10))
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,10))
//SYSINDD*
RESTORE BACKOUT,JOBNAME=jobname,STEPNAME=stepname,
JOBID=JOBnnnnn
/*
Forward Recovery
A forward recovery may be necessary if an IAM file is damaged due to hardware media failures, or due to software failures. The first step for such a recovery is to restore the IAM data set from a backup copy. The backup could have been done by an FDRREORG, IDCAMS, or some other application, or it could have been done by a DASD management utility such as FDRABR or DFSMSdss. Once the data set is restored, you can use IAMJREST to re-apply all of the updates that had occurred to the data set prior to the failure. For the forward recovery, you would want to specify the FROMDATE and FROMTIME being the time that the backup started, and specify the IAM data set that is being recovered.
In the example below, there is the presumption that the current IAM/RLS journal data sets have all of the necessary data to perform the recovery, so no journal data sets are specified in the JCL.
Example of a Forward Recovery (EX2070D)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//IAMINFO DD SYSOUT=*
//SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(50,10))
//SORTWK02 DD UNIT=SYSDA,SPACE=(CYL,(50,10))
//SORTWK03 DD UNIT=SYSDA,SPACE=(CYL,(50,10))
//SYSIN DD *
RESTORE FORWARD,DSN=bad.iam.file,FROMDATE=yyyyddd,
FROMTIME=hhmmss
/*