Restoring multiple libraries

You can use the Restore Library (RSTLIB) command to restore multiple libraries.

Use the RSTLIB command to restore libraries in these groups:

*NONSYS
All libraries that were saved with the SAVLIB LIB(*NONSYS) command, including the IBM-supplied libraries QSYS2, QGPL, QUSRSYS, and licensed program libraries.
*ALLUSR
All user libraries that were saved with SAVLIB LIB(*ALLUSR) or SAVLIB LIB(*NONSYS).
*IBM
All IBM-supplied libraries that were saved with SAVLIB LIB(*IBM) or SAVLIB(*NONSYS). Only IBM-supplied libraries that contain IBM® objects are restored.
Start of change*ANYEnd of change
Start of changeThe first version of all saved libraries that are found on the tape are restored, beginning with the sequence number specified for the SEQNBR parameter. When you restore from optical media, all saved libraries are restored that are found in the directory specified for the Optical file (OPTFILE) parameter.End of change
Start of change*SELECTEnd of change
Start of changeThe libraries that are specified for the Select (SELECT) parameter are restored.End of change
User-specified (up to 300 repetitions)
generic-name – You can specify the generic name of the library to be restored. A generic name is specified as a character string that contains one or more characters followed by an asterisk (*). If a generic name is specified, then all objects that have names with the same prefix as the generic object name are selected.

name – You can specify the names of the libraries to be restored. The names of the libraries being restored must be the same as the names that were used when the libraries were saved.

Figure 1 shows which libraries are saved and restored in these groups. If you are restoring any of the following libraries, QSYS2, QGPL, QUSRSYS, or QSYS2nnnnn, where nnnnn specifies an independent auxiliary storage pool (ASP) number, you must restore them before restoring any other user libraries. If you use the special values (*ALLUSR or *NONSYS), the system restores these libraries in the correct sequence.

Start of changeWhen you restore a group of libraries, you can omit up to 300 libraries by using the OMITLIB parameter. You can specify to omit specific libraries or you can specify to omit generic names for the libraries to be omitted. The libraries you omit are not restored from the save media. You can also use the OMITOBJ parameter to omit up to 300 specific object names or generic object names. You can also use the SELECT parameter to select libraries and objects to include or omit.End of change

When you use a media definition to restore libraries that were saved in parallel with one of the following groups specified, *ALLUSR, *IBM, *NONSYS, or a generic value such as X*, you might have to perform some involved recovery operations. You must first load each drive with the volume that contains the QFILE so that the system can verify that each library resulted from the same save operation. You will then have to answer an inquiry message for each drive to position it to the correct volume, if you are starting the recovery on a library other than *FIRST.

Note: If you have related objects, such as physical and logical files or journals and journaled objects, in different libraries, you must ensure that you restore them in the correct sequence.