Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Restore Library (RSTLIB) command restores to the system one library or a group of libraries that was saved by the Save Library (SAVLIB) command. The Restore Library (RSTLIB) command restores the whole library, which includes the library description, object descriptions, and contents of the objects in the library.
For job queues, message queues, user queues, and logical files, only the object descriptions are restored, because only the definitions are saved. Also, logical file access paths may be restored if they were saved. More information on restoring access paths is in the Database information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter. The contents of spooled files on output queues can be restored, if they were saved, by specifying *NEW for the Spooled file data (SPLFDTA) parameter.
This command can be used to restore libraries whose objects had their storage freed by the corresponding SAVLIB command of the restore operation, or libraries deleted by the Delete Library (DLTLIB) command. If the data portions of the objects in the saved libraries were not freed, each library is copied into the same area of storage that it previously occupied. If the storage was freed, the system finds the needed storage to store the library contents (the object description and data portion of every file, module, program, service program, Structured Query Language (SQL) package, and journal receiver in the library). If the library does not exist on the system because it has been deleted or is being restored on a different system, the system must find the storage for everything that is in the library, including the library description.
When the owner profile does not exist on the system, the user profile of the system default owner (QDFTOWN) becomes the default owner of any object being restored in the system.
If an object already exists in the library in which it is being restored, the public and private authorities of the existing object are retained. If the object does not exist in the library, all public authorities are restored, but private authorities must be granted again. For an existing output queue object that is actively spooling during the restore operation, or a data queue that already exists in the library, the object is not restored, and a diagnostic message is sent.
If an object is being restored over an existing object on the system, the object auditing value of the existing object is kept. If the object is being restored as new to the system, the object auditing value is restored from the media. Additionally, if the object is a library, the default auditing value for each object created in the library is restored if the library is being restored as new; otherwise, the default auditing value is restored from the media.
Notes:
Restrictions:
If you do not have the correct authority for all the libraries and objects specified, only those for which you have authority are restored.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
SAVLIB | Saved library | Single values: *NONSYS, *ALLUSR, *IBM, *ANY Other values (up to 300 repetitions): Generic name, name |
Required, Positional 1 |
DEV | Device | Single values: *SAVF, *MEDDFN Other values (up to 4 repetitions): Name |
Required, Positional 2 |
VOL | Volume identifier | Single values: *MOUNTED, *SAVVOL Other values (up to 75 repetitions): Character value |
Optional, Positional 3 |
SEQNBR | Sequence number | 1-16777215, *SEARCH | Optional, Positional 4 |
LABEL | Label | Character value, *SAVLIB | Optional |
ENDOPT | End of media option | *REWIND, *LEAVE, *UNLOAD | Optional |
STRLIB | Starting library | Name, *FIRST | Optional |
SAVF | Save file | Qualified object name | Optional |
Qualifier 1: Save file | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
MEDDFN | Media definition | Qualified object name | Optional |
Qualifier 1: Media definition | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
OPTFILE | Optical file | Path name, * | Optional |
OMITLIB | Libraries to omit | Single values: *NONE Other values (up to 300 repetitions): Generic name, name |
Optional |
OPTION | Option | *ALL, *NEW, *OLD, *FREE | Optional |
MBROPT | Data base member option | *MATCH, *ALL, *NEW, *OLD | Optional |
SPLFDTA | Spooled file data | *NEW, *NONE | Optional |
SAVDATE | Date when saved | Date | Optional |
SAVTIME | Time when saved | Time | Optional |
ALWOBJDIF | Allow object differences | Single values: *NONE, *ALL Other values (up to 4 repetitions): *AUTL, *FILELVL, *OWNER, *PGP |
Optional |
FRCOBJCVN | Force object conversion | Single values: *SYSVAL, *NO Other values: Element list |
Optional |
Element 1: Convert during restore | *YES | ||
Element 2: Objects to convert | *RQD, *ALL | ||
RSTLIB | Restore to library | Name, *SAVLIB | Optional |
RSTASPDEV | Restore to ASP device | Name, *SAVASPDEV | Optional |
RSTASP | Restore to ASP number | 1-32, *SAVASP | Optional |
OUTPUT | Output | *NONE, *PRINT, *OUTFILE | Optional |
OUTFILE | File to receive output | Qualified object name | Optional |
Qualifier 1: File to receive output | Name | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
OUTMBR | Output member options | Element list | Optional |
Element 1: Member to receive output | Name, *FIRST | ||
Element 2: Replace or add records | *REPLACE, *ADD | ||
INFTYPE | Type of output information | *OBJ, *MBR | Optional |
OMITOBJ | Objects to omit | Values (up to 300 repetitions): Element list | Optional |
Element 1: Object | Qualified object name | ||
Qualifier 1: Object | Generic name, name, *NONE, *ALL | ||
Qualifier 2: Library | Generic name, name, *ALL | ||
Element 2: Object type | Character value, *ALL |
Top |
Specifies the libraries to be restored to the system.
Notes:
This is a required parameter.
Single values
You can do a RSTLIB SAVLIB(*IBM) and a RSTLIB SAVLIB(*ALLUSR) from a SAVLIB LIB(*NONSYS).
#CGULIB #DSULIB #SEULIB #COBLIB #RPGLIB #DFULIB #SDALIB
Although the following Qxxx libraries are provided by IBM, they typically contain user data that changes frequently. Therefore, these libraries are considered "user libraries", and are also restored:
QDSNX QRCLxxxxx QUSRIJS QUSRVxRxMx QGPL QSRVAGT QUSRINFSKR QGPL38 QSYS2 QUSRNOTES QMGTC QSYS2xxxxx QUSROND QMGTC2 QS36F QUSRPOSGS QMPGDATA QUSER38 QUSRPOSSA QMQMDATA QUSRADSM QUSRPYMSVR QMQMPROC QUSRBRM QUSRRDARS QPFRDATA QUSRDIRCL QUSRSYS QRCL QUSRDIRDB QUSRVI
QDOC QRCYxxxxx QTEMP QUSRRDARS QDOCxxxx QRECOVERY QUSER38 QUSRSYS QDSNX QRPLOBJ QUSRADSM QUSRVI QGPL QRPLxxxxx QUSRBRM QUSRVxRxMx QGPL38 QSPL QUSRDIRCL QMGTC QSPLxxxx QUSRDIRDB QMGTC2 QSRV QUSRIJS QMPGDATA QSRVAGT QUSRINFSKR QMQMDATA QSYS QUSRNOTES QMQMPROC QSYSxxxxx QUSROND QPFRDATA QSYS2 QUSRPOSGS QRCL QSYS2xxxxx QUSRPOSSA QRCLxxxxx QS36F QUSRPYMSVR
Note: A different library name, in the format QUSRVxRxMx, can be created by the user for each previous release supported by IBM to contain any user commands to be compiled in a CL program for the previous release. For the QUSRVxRxMx user library, VxRxMx is the version, release, and modification level of a previous release that IBM continues to support.
The following libraries with names that do not begin with the letter Q are also restored:
#CGULIB #DSULIB #SEULIB #COBLIB #RPGLIB #DFULIB #SDALIB
Other values (up to 300 repetitions)
Note: 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.
Top |
Specifies the name of the device used for the restore operation. The device name must already be known on the system by a device description.
This is a required parameter.
Single values
Other values
Top |
Specifies the volume identifiers of the media or the cartridge identifiers of tapes in a tape media library device, from which the objects are being restored. The volumes must be in the same order as they were when the data was saved. The volume that contains the beginning of the file to be restored should be placed in the device.
Note: The first version of the saved library that is found on the media is restored, unless a specific version is identified by the Date when saved (SAVDATE) and Time when saved (SAVTIME) parameters or, for tape, the Sequence number (SEQNBR) parameter.
Single values
Note: This value cannot be specified when using an optical media library device.
Other values (up to 75 repetitions)
Top |
Specifies, when tape is used, which sequence number is used for the restore operation.
If *NONSYS, *ALLUSR, or *IBM is specified for the Saved library (SAVLIB) parameter, the sequence number specifies the location of the file QFILE. The QFILE file is at the beginning of the *NONSYS, *ALLUSR, or *IBM save operation. The QFILE file contains the list of libraries saved.
Top |
Specifies the name that identifies the data file to be used for the restore operation. This label must have been specified on the save command.
Top |
Specifies the operation that is automatically done on the tape or optical volume after the restore operation ends. If more than one volume is used, this parameter applies only to the last volume used; all other volumes are unloaded when the end of the volume is reached.
Note: This parameter is valid only if a tape or optical device name is specified for the DEV parameter. For optical devices, *UNLOAD is the only special value supported, *REWIND and *LEAVE will be ignored.
Top |
Specifies the name of the starting library for a *NONSYS, *IBM, or *ALLUSR restore operation.
If an unrecoverable media error occurs during the restore operation, this parameter can be used to restart the operation.
Note: In the recovery steps that follow, *NONSYS is specified for the Saved library (SAVLIB) parameter of this command. If you are restoring IBM-supplied libraries or all user-created libraries and IBM-supplied libraries, specify *IBM or *ALLUSR instead.
The basic recovery steps for a restore operation are:
RSTLIB SAVLIB(*NONSYS) DEV(TAP01) ENDOPT(*LEAVE) STRLIB(library-name) OMITLIB(library-name)
where the library-name for the STRLIB and OMITLIB parameters is the library where the last RSTLIB failed. This starts the restore operation on the library after the library where the restore operation failed.
Note: Consider removing the tape with the media error from the next save rotation cycle to avoid another tape error.
Note: This parameter is valid only if *NONSYS, *IBM, or *ALLUSR is specified for the SAVLIB parameter.
Top |
Specifies the save file used to restore the data.
Note: A value must be specified for this parameter if *SAVF is specified for the Device (DEV) parameter.
Qualifier 1: Save file
Qualifier 2: Library
Top |
Specifies the media definition (*MEDDFN) object that identifies the devices and media used to restore the data. For information about creating and using a media definition, see the Backup and Recovery book, SC41-5304, and the Create Media Definition API in the System API Reference information in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
If a media definition is specified, the VOL, SEQNBR, SAVF, and OPTFILE parameters cannot be specified. The volume identifiers and sequence numbers are specified in the media definition.
Qualifier 1: Media definition
Qualifier 2: Library
Top |
Specifies the path name of the optical file that is used for the restore operation, beginning with the root directory of the volume.
For more information on specifying path names, refer to "Object naming rules" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
Specifies a list of libraries to be excluded from the restore operation.
Single values
Other values (up to 300 repetitions)
Note: 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.
Top |
Specifies how to handle restoring each object.
Top |
Specifies, for database files that exist on the system, which members are restored. If *MATCH is used, the member list in the saved file must match, member for member, the current version on the system. All members are restored for files that do not exist, if the file is restored.
Top |
Specifies whether to restore spooled file data and attributes.
Top |
Specifies the date when the library was saved. If the most recently saved version is not restored, or if more than one saved version is on the volumes, type the date that specifies which version of the library is restored.
If a volume identifier or *MOUNTED is specified for the Volume identifier (VOL) parameter, but this parameter is not specified, the first version of the library found on the volume is restored. This parameter is not valid with VOL(*SAVVOL).
Top |
Specifies the time when the library was saved, if the current version is not restored.
If a volume identifier or *MOUNTED is specified for the Volume identifier (VOL) parameter, but this parameter is not, the first version of the library found on the volume is restored. This parameter is valid only if the Date when saved (SAVDATE) parameter is also specified.
Top |
Specifies whether differences are allowed between the saved objects and the restored objects.
Notes:
The types of differences include:
Note: This parameter has no effect when the saved object did not have an authorization list. If the object exists, it is restored with the authorization list of the existing object. If it does not exist, it is restored with no authorization list.
Single values
Other values (up to 4 repetitions)
If this value is not specified, authorization list differences are not allowed. If the saved object had an authorization list and the object exists on the system but does not have the same authorization list, the object is not restored. If the saved object had an authorization list and the object does not exist and it is being restored to a different system than the save system, the object is restored, but it is not linked to the authorization list, and the public authority is set to *EXCLUDE.
If this value is not specified, file level id and member level id differences are not allowed. If an object already exists on the system with a different file level id or member level id than the saved object, the object is not restored.
If this value is not specified, ownership differences are not allowed. If an object already exists on the system with a different owner than the saved object, the object is not restored.
If this value is not specified, primary group differences are not allowed. If an object already exists on the system with a different primary group than the saved object, the object is not restored.
Top |
Specifies whether to convert user objects to the format required for use in the current version of the operating system when the objects are restored.
Notes:
Single values
Note: If FRCOBJCVN(*NO) is specified, then the QFRCCVNRST system value must have a value of either "0" or "1".
Element 1: Convert during restore
Notes:
Element 2: Objects to convert
Top |
Specifies whether the library contents are restored to the same library in which they were saved, or to a different library.
Note: If a Structured Query Language (SQL) database is restored to a library other than the one in which it was saved, the journals are not restored.
Top |
Specifies the auxiliary storage pool (ASP) device to which the data is to be restored.
Note: You can specify either the RSTASPDEV parameter or the RSTASP parameter, but not both.
Top |
Specifies whether objects are restored to the auxiliary storage pool (ASP) from which they were saved or to the system ASP (ASP number 1) or to a basic user ASP (ASP numbers 2 through 32).
Some objects cannot be restored to user ASPs. More information about object types which can be restored to user ASPs is in the Backup and Recovery book, SC41-5304. If the library exists in, or is being restored to the system ASP, journals, journal receivers, and save files can be restored to basic user ASPs. All other object types will be restored to the ASP of the library.
ATTENTION: System or product libraries (libraries that begin with a Q or #) must not be created in or restored to a user ASP. Doing so can cause unpredictable results.
Top |
Specifies whether a listing that shows information about the status of the objects is created and directed to an output file. The listing shows the restore information and shows all objects restored, not restored, and excluded. Information about each object's security is listed for the restored objects.
Note: You must specify a database file name for the OUTFILE parameter when OUTPUT(*OUTFILE) is specified.
Top |
Specifies the database file to which the information is directed when *OUTFILE is specified for the Output (OUTPUT) parameter. If the file does not exist, this command creates a database file in the specified library. If a new file is created, the system uses QASRRSTO in QSYS with the format name QSRRST as a model.
Qualifier 1: File to receive output
Qualifier 2: Library
Top |
Specifies the name of the database file member to which the output is directed when *OUTFILE is specified for the Output (OUTPUT) parameter.
Element 1: Member to receive output
If the member exists, you can add records to the end of the existing member or clear the existing member and add the records.
Element 2: Replace or add records
Top |
Specifies the type of information which is printed or directed to the database file.
Top |
Specifies the objects to be excluded from the operation. Up to 300 objects or generic object values can be specified.
Element 1: Object
Qualifier 1: Object
Note: 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.
Qualifier 2: Library
Note: 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.
Element 2: Object type
To see a complete list of object types when prompting this command, position the cursor on the field for this parameter and press F4 (Prompt). For a description of the object types, see "Object types" in the CL concepts and reference topic in the iSeries Information Center at http://www.ibm.com/eserver/iseries/infocenter.
Top |
Example 1: Restoring New Objects
RSTLIB SAVLIB(JOE) DEV(TAP01) OPTION(*NEW)
This command restores the saved version of library JOE from tape device TAP01. The only objects that are restored in the library are new objects (ones that were in the library when they were saved and later deleted).
Example 2: Printing Output
RSTLIB SAVLIB(*NONSYS) DEV(TAP01) OUTPUT(*PRINT)
This command restores all the saved nonsystem libraries to the system from tape. The contents of the libraries are restored exactly as they were saved. New objects (on tape) are added to the system; old objects in the system are overlaid by the version of the old objects on tape. Because OUTPUT(*PRINT) is specified, a printout of all objects (restored and not restored) for each library, is sent to the printer with the job's spooled output. Each library after the first library starts on a new page. After each library, a completion message states how many objects were restored and how many were not restored. At the end of a list, a final completion message states how many libraries were restored and how many were not restored.
Example 3: Specifying Where the Restore Operation Begins
RSTLIB SAVLIB(*NONSYS) DEV(TAP01) STRLIB(MIKESLIB)
This command restores the saved nonsystem libraries beginning with library MIKESLIB from the tape device, TAP01. The first tape of the nonsystem save must be loaded. An inquiry message instructs the user to load the tape containing MIKESLIB. If necessary, the same message is sent until the tape containing MIKESLIB is found.
Example 4: Restoring a Version From a Specific Date and Time
RSTLIB SAVLIB(PAYROLL) DEV(TAP01) SAVDATE(060193) SAVTIME(103214) RSTLIB(OLDPAY) VOL(PAY)
This command restores the version of the PAYROLL library from the device TAP01, whose volume identifier is PAY. The version to be restored was saved at 10:32:14 on the date 06/01/93. All of the objects in the saved PAYROLL library are restored to the library OLDPAY. All new files are restored. Old files are restored only if the member lists of the files on the tape match the member lists of the files on the system.
Example 5: Restoring From Multiple Tape Volumes
RSTLIB SAVLIB(QGPL) DEV(TAP01) VOL(QGPL QGPL)
This command restores the QGPL library from two tape volumes both named QGPL. Even though the volume identifiers are the same, they must both be specified.
Example 6: Restoring From Multiple Tape Devices Serially
RSTLIB SAVLIB(USRLIB) DEV(TAP01 TAP02 TAP03) VOL(USRA USRB USRC USRD) ENDOPT(*UNLOAD)
This command restores library USRLIB from four volumes on three tape devices. Volume USRA is put on tape device TAP01, volume USRB on TAP02, volume USRC on TAP03, and volume USRD on TAP01. The operator removes volume USRA from TAP01, so that TAP01 can be used by volume USRD. If the tape volumes are put in the wrong order, an error message is sent to the system operator message queue.
Example 7: Restoring From Multiple Devices in Parallel
RSTLIB SAVLIB(USRLIB) DEV(*MEDDFN) MEDDFN(LIBA/MEDDFNA)
This command restores library USRLIB using the devices and volumes specified in the media definition named MEDDFNA in library LIBA. For information about creating and using a media definition, see the Backup, Recovery, and Availability topic in the Information Center.
Example 8: Restoring a Specific Version
RSTLIB SAVLIB(LIB1) DEV(TAP01) MBROPT(*ALL) SAVDATE(082392) SAVTIME(123251) RSTLIB(LIB2) OUTPUT(*PRINT)
This command restores the version of library LIB1 from the device TAP01. The version to be restored was saved at 12:32:51 on the date 08/23/92. All of the objects in the saved library LIB1 are restored to library LIB2. A list of restored objects and those not restored is given. All files and file members are restored.
Example 9: Restoring a Library From a Save File
RSTLIB SAVLIB(LIB1) DEV(*SAVF) SAVF(SAVF1)
This command restores library LIB1 from the save file SAVF1.
Example 10: Restoring to a Basic User ASP
RSTLIB SAVLIB(LIB1) DEV(*SAVF) SAVF(SAVF1) RSTASP(2)
This command restores the library named LIB1 from the save file named SAVF1. The library and all objects in the saved version of LIB1 are restored to basic user auxiliary storage pool (ASP) 2 unless:
Example 11: Restoring to an Independent ASP
RSTLIB SAVLIB(LIB1) DEV(*SAVF) SAVF(SAVF1) RSTASPDEV(DIVISION1)
This command restores the library named LIB1 from the save file named SAVF1. The library and all objects in the saved version of LIB1 are restored to the independent ASP named DIVISION1 unless:
Example 12: Restoring More Than One Library From Tape
RSTLIB SAVLIB(*ANY) DEV(TAP01) SEQNBR(75)
This command restores the first saved version of each library from tape device TAP01 starting at tape file sequence number 75.
Example 13: Restoring More Than One Library From Optical
RSTLIB SAVLIB(A* B*) DEV(OPT01) OPTFILE('/BACKUP/*')
This command restores all libraries whose names start with A or B that are found in directory BACKUP on the optical volume in device OPT01.
Example 14: Restoring Spooled Files
RSTLIB SAVLIB(JOE) DEV(TAP01) SPLFDTA(*NEW)
This command restores the saved version of library JOE from tape device TAP01. Any spooled files that do not currently exist on the system and that were saved with output queues in this library are restored.
Top |
*ESCAPE Messages
*STATUS Messages
Top |