Restoring logical files
When you restore a logical file, the system uses the description for the logical file to establish its relationship with the based-on files. For example, database views or indexes are logical files.
If the based-on files do not exist, you can do a deferred restore of those logical files. You also can restore physical and logical files in any order.
You can restore a logical file to a library different than the library for the associated physical file. However, the associated physical file must remain in or be restored to its original library location.
If you try to restore a logical file to a library in which it does not exist, the restore operation fails if any of the associated physical files have had their storage freed.
When a logical file is restored, it must be dependent on the same physical files as it was when it was saved.
- The logical file is created over the physical files in the library where
they are being restored if any of the following situations occur:
- The logical file and the associated physical files existed in the same library at the time of the save operation.
- The logical file and the associated physical files are present in the library where the files are being restored.
- The logical file and the associated physical files are being restored to the same library.
- If the files are not present in the restore library, then the logical
files are created over the physical files in the original saved library.Note: When deferred files are restored, the system looks for the based-on files in the SAVLIB library, but not in the RSTLIB library.
- If the correct physical files are not found in either library, the restore operation of the logical file fails. To correct the problem, run the Restore Object (RSTOBJ) command again and specify OBJ(*NEW). If the restore operation is successful, an informational message (CPF3291) is sent to indicate which library was used for associated physical files.
The creation dates of the physical files must not have changed because the logical file was saved. If the date has changed, an informational message (CPF3293) is sent indicating that the physical file has been changed since the save operation, but the restore operation continues.
Restore physical or logical files with dependent logical files before the dependent logical files, unless the physical and logical files already exist on the system, or a defer ID is specified on the restore operation. The following considerations apply to restoring logical files:
- If the dependent physical or logical files are in the same library, the system provides the proper sequencing.
- If the files are in different libraries, you must restore the libraries in order, so that the physical or logical files that have logical files built on them are restored first, or you must specify a defer ID for the restore operation.
- If the depended-on physical or logical files are not restored before you attempt to restore the logical files, and if no defer ID is specified on the restore command, restoring the logical files fails.
- This sequencing also applies to other requirements between files, such as shared formats. You can restore those logical files that failed by using the RSTOBJ command.
- If the logical files and MQTs contain missing based-on files, you can set up a deferred restore by specifying the Defer ID (DFRID) parameter on the RSTOBJ or Restore Library (RSTLIB) command. When the based-on files become available, you can complete the deferred restore by using the Restore Deferred Objects (RSTDFROBJ) command.