Deferring object journaling during restore
Using deferred journaling support allows the system to manage the reestablishment of journaling of objects after a restore.
Previously, restoring journaled objects from multiple libraries or from a library other than the library of the dependent journal was difficult to manage. If a journaled object was restored before the library of the journal, the object was not journaled. After the journal was restored, the user had to manually start journaling for each of the restored objects. With deferred journaling, the journaling of objects during restore can be deferred when there is a dependency on a journal in a library that does not yet exist. The journal information is cached and used to start journaling after the journal becomes available. This eliminates the manual effort that is required to restart journaling.
To defer the journaling of objects on restore when the journal does not yet exist, specify the Defer ID (DFRID) parameter on the Restore Library (RSTLIB) or Restore Object (RSTOBJ) command. Specifying the same defer ID for multiple restore operations provides an association between the deferred journaling information and the dependent journal.
When the journal becomes available, the Restore Deferred Objects (RSTDFROBJ) command can be used with the previously specified defer ID to start journaling using the deferred journaling information.
After the deferred journaling operation completes, use the Remove Defer ID (RMVDFRID) command to remove the deferred journaling information from the cache.
When journaling is started for the object because of a RSTDFROBJ, the restore and create journal entries for these objects will not be generated because the object which deferred start journaling was created before the creation of the journals.
If a user has save system (*SAVSYS) special authority and uses the RSTLIB command and specifies the *NONSYS, *ALLUSR, or *IBM values for the Saved Library (SAVLIB) parameter and specifying *DFT for the DFRID parameter, the system manages the deferred journaling information. In all other cases, if the user omits the DFRID parameter, the user must manage the start journaling requests.
Multiple restore operations can run concurrently using the same defer ID. It is best to wait until all of the restore operations are complete for that defer ID before issuing the RSTDFROBJ or RMVDFRID commands. Issuing the RSTDFROBJ command while restores are still running can cause extra work in processing. Issuing the RMVDFRID command while restores are still running can cause deferred journaling information to be lost.
If a journaled object is restored with either the RSTLIB or RSTOBJ with a defer ID specified and the object is renamed or moved to a different library before the issuance of the RSTDFROBJ command, journaling will not be started for that object.
When an object is restored into a journaled library with a *RESTORE inherit rule defined and a Defer ID specified, the Defer ID takes precedence. If the journal the object was journaled to at save time does not exist a deferral record is written and the object is not journaled to the journal specified by the *RESTORE inherit rule.
When restoring an object into a journaled library that has a *RSTOVRJRN inherit rule defined, the object attempts to automatically start journaling to the journal used by the library, regardless of whether the object was journaled when it was saved, what the journal target was at save time, or if a defer id was specified on the restore.
When restoring an object into a library that contains a data area named QDFTJRN that has a *RSTOVRJRN rule defined, the object attempts to automatically start journaling to the journal specified in the QDFTJRN data area, regardless of whether the object was journaled when it was saved, what the journal target was at save time, or if a defer id was specified on the restore. If the journal specified in the QDFTJRN data area does not exist and a defer id was specified on the restore, the start of journaling is deferred.
Deferred restore examples
This command restores all the saved non-system libraries to the system from tape. The system manages the deferred journaling for objects that are restored before their journal is restored. The system attempts to automatically start journaling of the dependent objects when the journal is finally restored.
RSTLIB SAVLIB(*NONSYS) DEV(TAP01) DFRID(*DFT)
The next examples show libraries that are being restored using a DFRID. Library JRNLIB contains the journals that the objects in library OBJLIB were journaled to. The objects in OBJLIB cannot start journaling until after the journals in JRNLIB are restored. A defer ID is specified, so the start journaling requests are deferred. Use the RSTDFROBJ command to start journaling these files. The RMVDFRID command removes information about objects that were deferred during the restore operation.
RSTLIB SAVLIB(OBJLIB) DEV(TAPE01) ENDOPT(*LEAVE) DFRID(ABC)
RSTLIB SAVLIB(JRNLIB) DEV(TAPE01) ENDOPT(*LEAVE) DFRID(ABC)
RSTDFROBJ DFRID(ABC)
RMVDFRID DFRID(ABC)