Restore Library (RSTLIB)

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:

  1. To restore a save file to a library where it does not already exist, have *USE authority to the Create Save File (CRTSAVF) command.

  2. The RSTLIB command ignores all file overrides currently in effect for the job, except the overrides for the restore output file.

Restrictions:

Top


 

Parameters

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

 

Saved library (SAVLIB)

Specifies the libraries to be restored to the system.

Notes:

  1. If you specify more than one library, or a special value, or a generic value:

    • The Device (DEV) parameter must not specify *SAVF.

    • The Restore to library (RSTLIB) parameter must specify *SAVLIB.

    • The Label (LABEL) parameter must specify *SAVLIB.

    • The Optical file (OPTFILE) parameter must specify * or end with /*.

  2. For values *NONSYS and *IBM, all other operations on the system must be ended before this option is specified. This requires ending all subsystems through the End Subsystem (ENDSBS) command or the End System (ENDSYS) command.

  3. The tape or optical file that you select to restore may contain a library that does not match the value that you specify for this parameter. This parameter is used to determine the default LABEL value for a tape file and the default OPTFILE value for an optical file, but the restore operation does not verify that this parameter matches the saved library.

This is a required parameter.

Single values

*NONSYS

Libraries saved by the Save Library (SAVLIB) command with LIB(*NONSYS) specified are restored.

You can do a RSTLIB SAVLIB(*IBM) and a RSTLIB SAVLIB(*ALLUSR) from a SAVLIB LIB(*NONSYS).

*ALLUSR

All user libraries are restored. All libraries with names that do not begin with the letter Q are restored except for the following:

 #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 

*IBM

Restores all IBM-supplied libraries except for the following:

 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 

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 

*ANY

Restores the first version of all saved libraries found on the tape beginning with the sequence number specified for the Sequence number (SEQNBR) parameter, or restores all saved libraries found on the optical media in the directory specified for the Optical file (OPTFILE) parameter.

Other values (up to 300 repetitions)

generic-name

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

Specify the name of the library to be restored. The name of the library being restored must be the same as the name that was used when the library was saved.

Top

 

Device (DEV)

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

*SAVF

The restore operation is done using the save file specified for the Save file (SAVF) parameter.

*MEDDFN

The restore operation is done using the devices and media identified in the media definition specified for the Media definition (MEDDFN) parameter.

Other values

optical-device-name

Specify the name of the optical device used for the restore operation.

tape-media-library-device-name

Specify the name of the tape media library device used for the restore operation.

tape-device-name

Specify the names of one or more tape devices used for the restore operation. If a virtual tape device is used, it must be the only device specified. If you are using more than one tape device (up to a maximum of four), specify the names of the devices in the order in which they are used. When more than one tape volume is to be restored, using more than one tape device permits one tape volume to be rewound while another tape device processes the next tape volume. To use more than one device in parallel, a media definition must be specified.

Top

 

Volume identifier (VOL)

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.

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

*MOUNTED

The objects are restored from the volumes placed in the device specified for the Device (DEV) parameter. For a media library device, the volume to be used is the next cartridge in the category mounted by the Set Tape Category (SETTAPCGY) command.

This value cannot be specified when using an optical media library device.

*SAVVOL

The system, by using the save or restore history information, determines which volumes contain the most recently saved version of the library. If the device type of the device specified for the Device DEV) parameter does not match the device type of the most recently saved version of the library, an error message is sent to the user, and the function is ended. If *SAVVOL is specified, the SAVDATE and SAVTIME parameters cannot be specified. If *SAVVOL is specified, *SEARCH must be specified for the SEQNBR parameter.

Other values (up to 75 repetitions)

character-value

Specify the identifiers of one or more volumes in the order in which they are placed in a device and used to restore the data.

Top

 

Sequence number (SEQNBR)

Specifies, when tape is used, which sequence number is used for the restore operation.

*SEARCH

The volume in the device is searched for a data file with an identifier that matches the FROMLABEL parameter value; when a match is found, the object is restored. If the last operation on the device specified *LEAVE for the End of tape option (ENDOPT) parameter, indicating that the tape is positioned at the location where the last operation ended, the file search starts with the first data file beyond the current tape position. If *LEAVE was not used for the End of tape option (ENDOPT) parameter of the last operation, or if the tape was manually rewound since the operation, the search starts with the first data file on the volume.

1-16777215

Specify the sequence number of the file to be 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

 

Label (LABEL)

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.

*SAVLIB

The file label is the name specified for the Saved library (SAVLIB) parameter.

character-value

Specify the data file identifier of the data file used for the restore operation. A maximum of 17 characters can be used. This option is valid only for a single-library restore.

Top

 

End of media option (ENDOPT)

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.

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.

*REWIND

The tape is automatically rewound, but not unloaded, after the operation has ended.

*LEAVE

The tape does not rewind or unload after the operation ends. It remains at the current position on the tape drive.

*UNLOAD

The tape is automatically rewound and unloaded after the operation ends. Some optical devices will eject the volume after the operation ends.

Top

 

Starting library (STRLIB)

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.

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:

  1. Look at the job log to determine the library where the previous restore library (RSTLIB SAVLIB(*NONSYS)) command failed. Find the last library restored, which is indicated by a successful restore completion message.

  2. Load the first tape of the SAVLIB LIB(*NONSYS) media.

  3. Type the following command, and then press the Enter key:

     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.

  4. When you are prompted, load the volume containing the starting library.

  5. After the restore operation is complete, restore the library where the restore operation failed using the media from a previous save operation.

    Consider removing the tape with the media error from the next save rotation cycle to avoid another tape error.

This parameter is valid only if *NONSYS, *IBM, or *ALLUSR is specified for the SAVLIB parameter.

*FIRST

The restore operation begins with the first library saved.

name

Specify the name of the library with which to start the restore operation.

Top

 

Save file (SAVF)

Specifies the save file used to restore the data.

A value must be specified for this parameter if *SAVF is specified for the Device (DEV) parameter.

Qualifier 1: Save file

name

Specify the name of save file to be used.

Qualifier 2: Library

*LIBL

All libraries in the library list for the current thread are searched until the first match is found.

*CURLIB

The current library for the thread is used to locate the save file. If no current library entry exists in the library list, the QGPL library is used.

name

Specify the name of the library where the save file is located.

Top

 

Media definition (MEDDFN)

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

name

Specify the name of the media definition to be used.

Qualifier 2: Library

*LIBL

All libraries in the library list for the current thread are searched until the first match is found.

*CURLIB

The current library for the thread is searched. If no library is specified as the current library for the thread, the QGPL library is searched.

name

Specify the name of the library to be searched.

Top

 

Optical file (OPTFILE)

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.

*

The system searches the root directory of the optical volume for the default name generated by the corresponding save operation.

'optical-directory-path-name/*'

The system searches the specified directory of the optical volume for the default name generated by the corresponding save operation.

'optical-file-path-name'

Specify the path name of the optical file.

Top

 

Libraries to omit (OMITLIB)

Specifies a list of libraries to be excluded from the restore operation.

Single values

*NONE

No libraries are excluded from the restore operation.

Other values (up to 300 repetitions)

generic-name

Specify the generic name of the libraries to be excluded.

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.

library-name

Specify the name of the library to be excluded from the restore operation.

Top

 

Option (OPTION)

Specifies how to handle restoring each object.

*ALL

All the objects in the saved library are restored to the library. Objects in the saved library replace the current versions in the system library. Objects not having a current version are added to the system library. Objects presently in the library, but not on the media, remain in the library.

*NEW

Only the objects in the saved library that do not exist in the current version of the system library are added to the library. Only objects not known to the system library are restored; known objects are not restored. This option restores objects that were deleted after they were saved or that are new to this library. If any saved objects have a version already in the system library, they are not restored, and an informational message is sent for each one, but the restore operation continues.

*OLD

Only the objects in the library having a saved version are restored; that is, the version of each object currently in the library is replaced by the saved version. Only objects known to the library are restored. If any saved objects are no longer part of the online version of the library, they are not added to the library; an informational message is sent for each one, but the restore continues.

*FREE

The saved objects are restored only if they exist in the system library with their space freed. The saved version of each object is restored on the system in its previously freed space. This option restores objects that had their space freed when they were saved. If any saved objects are no longer part of the current version of the library, or if the space is not free for any object, the object is not restored and an informational message is sent for each one. The restore operation continues, and all of the freed objects are restored.

Top

 

Data base member option (MBROPT)

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.

*MATCH

The saved members are restored if the lists of the members where they exist match, member for member, the lists of the current system version. MBROPT(*MATCH) is not valid when *ALL is specified for the Allow object differences (ALWOBJDIF) parameter.

*ALL

All members in the saved file are restored.

*NEW

Only new members (members not known to the system) are restored.

*OLD

Only members already known to the system are restored.

Top

 

Spooled file data (SPLFDTA)

Specifies whether to restore spooled file data and attributes.

*NEW

For each output queue that is restored, spooled file data that was saved with the output queue is restored, if it does not already exist on the system.

*NONE

No spooled file data is restored.

Top

 

Date when saved (SAVDATE)

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).

date

Specify the date that the library to be restored was saved. The date must be entered in the job date format.

Top

 

Time when saved (SAVTIME)

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.

time

Specify the time that the library to be restored was saved. The time can be specified with or without a time separator:

  • Without a time separator, specify a string of 4 or 6 digits (hhmm or hhmmss) where hh = hours, mm = minutes, and ss = seconds.

  • With a time separator, specify a string of 5 or 8 digits where the time separator specified for your job is used to separate the hours, minutes, and seconds. If you enter this command from the command line, the string must be enclosed in apostrophes. If a time separator other than the separator specified for your job is used, this command will fail.

Top

 

Allow object differences (ALWOBJDIF)

Specifies whether differences are allowed between the saved objects and the restored objects.

Notes:

  1. You must have all object (*ALLOBJ) special authority to specify any value other than *NONE for this parameter.

  2. If differences are found, the final message for the restore operation is an escape message rather than the normal completion message.

The types of differences include:

Single values

*NONE

None of the differences listed above are allowed on the restore operation. See the description of each individual value to determine how differences are handled.

*ALL

All of the differences listed above are allowed on the restore operation. File level id and member level id differences are handled differently than the *FILELVL value. If there is a file level difference and *ALL is specified for the Data base member option (MBROPT) parameter, the existing version of the file is renamed and the saved version of the file is restored. If there is a member level difference, the existing version of the member is renamed and the saved version of the member is restored. This value will restore the saved data, but the result may not be correct. You will need to choose whether the restored data or the renamed data is correct, and you will need to make the necessary corrections to the database. For other differences, see the description of each individual value to determine how differences are handled.

Other values (up to 4 repetitions)

*AUTL

Authorization list differences are 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 restored with the authorization list of the existing object. 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 and it is linked to the authorization list. If the authorization list does not exist, the public authority is set to *EXCLUDE.

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.

*FILELVL

File level id and member level id differences are allowed. An attempt will be made to restore existing physical files even though the physical file on the save media may have a different file level id or member level id than the physical file on the system. The physical file data will only be restored for those physical files whose format level identifiers on the save media match the format level identifiers of the corresponding physical file on the system.

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.

*OWNER

Ownership differences are allowed. If an object already exists on the system with a different owner than the saved object, the object is restored with the owner of the object on the system.

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.

*PGP

Primary group differences are allowed. If an object already exists on the system with a different primary group than the saved object, the object is restored with the primary group of the object on the system.

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

 

Force object conversion (FRCOBJCVN)

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:

  1. This parameter applies only to user objects of the *MODULE, *PGM, *SRVPGM, and *SQLPKG object types.

  2. An object must have creation data (either observable or unobservable) to be converted.

  3. If an object needs to be converted (because it is formatted for an earlier version of the operating system), but is not converted during this restore operation, the object is automatically converted the first time it is used.

Single values

*SYSVAL

The objects are converted based on the value of the QFRCCVNRST system value.

*NO

The objects are not converted during the restore operation.

If FRCOBJCVN(*NO) is specified, then the QFRCCVNRST system value must have a value of either "0" or "1".

Element 1: Convert during restore

*YES

The objects are converted during the restore operation.

Notes:

  1. If FRCOBJCVN(*YES *RQD) is specified, then the QFRCCVNRST system value must have a value of "0", "1", or "2". FRCOBJCVN(*YES *RQD) will override a QFRCCVNRST value of "0" or "1". If FRCOBJCVN(*YES *ALL) is specfied, then QFRCCVNRST can have any valid value and FRCOBJCVN(*YES *ALL) overrides the QFRCCVNRST system value.

  2. Specifying this value increases the time of the restore operation, but avoids the need to convert the objects when they are first used.

Element 2: Objects to convert

*RQD

The objects are converted only if they require conversion to be used by the current operating system. If the objects do not have all creation data (either observable or unobservable), the objects cannot be converted and will not be restored.

*ALL

All objects are converted regardless of their current format, including objects already in the current format. However, if the objects do not have all creation data (either observable or unobservable), the objects cannot be converted and will not be restored.

Top

 

Restore to library (RSTLIB)

Specifies whether the library contents are restored to the same library in which they were saved, or to a different library.

*SAVLIB

The library contents are restored to the same library or libraries in which they were saved.

name

Specify the name of the library where the saved library contents are restored. If *NONSYS, *IBM, or *ALLUSR is specified for the Saved library (SAVLIB) parameter, a library name cannot be specified for this parameter.

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

 

Restore to ASP device (RSTASPDEV)

Specifies the auxiliary storage pool (ASP) device to which the data is to be restored.

You can specify either the RSTASPDEV parameter or the RSTASP parameter, but not both.

*SAVASPDEV

The data is restored to the same ASP from which it was saved.

name

Specify the name of the ASP device to be used.

Top

 

Restore to ASP number (RSTASP)

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.

*SAVASP

The objects are restored to the ASP from which they were saved.

1-32

Specifies the ASP number. When the specified ASP is 1, the specified objects are restored to the system ASP, and when the specified ASP is 2 through 32, the objects are restored to the basic user ASP specified.

Top

 

Output (OUTPUT)

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.

*NONE

No output is created.

*PRINT

The output is printed with the job's spooled output.

*OUTFILE

The output is directed to the database file specified for the File to receive output (OUTFILE) parameter.

You must specify a database file name for the OUTFILE parameter when OUTPUT(*OUTFILE) is specified.

Top

 

File to receive output (OUTFILE)

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

name

Specify the name of the database file to which output from the command is directed. If this file does not exist, it is created in the specified library.

Qualifier 2: Library

*LIBL

All libraries in the library list for the current thread are searched until the first match is found.

*CURLIB

The current library for the thread is used to locate the file. If no library is specified as the current library for the job, the QGPL library is used.

name

Specify the name of the library to be searched.

Top

 

Output member options (OUTMBR)

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

*FIRST

The first member in the file receives the output. If OUTMBR(*FIRST) is specified and the member does not exist, the system creates a member with the name of the file specified for the File to receive output (OUTFILE) parameter.

name

Specify the name of the file member that receives the output. If OUTMBR(member-name) is specified and the member does not exist, the system creates it.

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

*REPLACE

The existing records in the specified database file member are replaced by the new records.

*ADD

The new records are added to the existing information in the specified database file member.

Top

 

Type of output information (INFTYPE)

Specifies the type of information which is printed or directed to the database file.

*OBJ

The list contains an entry for each object requested to be restored.

*MBR

The list contains an entry for each object, database file member, and spooled file requested to be restored.

Top

 

Objects to omit (OMITOBJ)

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

*NONE

No objects are excluded from the operation.

*ALL

All objects of the specified object type are excluded from the operation.

generic-name

Specify the generic name of the objects to be excluded.

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

Specify the name of the object to be excluded from the operation.

Qualifier 2: Library

*ALL

The specified objects are excluded from all libraries that are part of the operation.

generic-name

Specify the generic name of the libraries that contain objects to be excluded.

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

Specify the name of the library that contains the object to be excluded from the operation.

Element 2: Object type

*ALL

All object types are excluded from the operation, depending on the value specified for the object name.

character-value

Specify the object type of the objects to be excluded from the operation.

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


 

Examples

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


 

Error messages

*ESCAPE Messages

CPF370C

Not authorized to ALWOBJDIF parameter.

CPF3705

&2 &1 in &3 not journaled.

CPF3706

&2 &1 not restored to library &3.

CPF3707

Save file &1 in &2 contains no data.

CPF3709

Tape devices do not support same densities.

CPF372C

Library &1 not restored to ASP &2.

CPF3727

Duplicate device &1 specified on device name list.

CPF3728

Device &1 specified with other devices.

CPF373E

Library &1 not restored to ASP &2.

CPF3730

Not authorized to &2 &1 in library &3.

CPF3731

Cannot use &2 &1 in library &3.

CPF3732

&2 &1 status error during restore operation.

CPF3733

&2 &1 in &3 previously damaged.

CPF3738

Device &1 used for save or restore is damaged.

CPF3739

Database file &1 member in &3 damaged.

CPF3740

Object &1 type &2 in &3 not found.

CPF3743

File cannot be restored, displayed, or listed.

CPF3748

Object information for library &1 damaged.

CPF375F

File not selected. Cannot restore from save type file &1.

CPF3752

No record of save operation exists for library &1.

CPF3757

&2 &1 not restored to &3.

CPF3758

&2 &1 not restored to &3.

CPF376B

File &1 not found.

CPF3767

Device &1 not found.

CPF3768

Device &1 not valid for command.

CPF3769

File found on media not save/restore file.

CPF3770

No objects saved or restored for library &1.

CPF3773

&1 objects restored. &2 not restored to &4.

CPF3779

&1 libraries restored; &4 partially restored; &2 not restored.

CPF378B

Library &1 not created.

CPF3780

Specified file for library &1 not found.

CPF3782

File &1 in &2 not a save file.

CPF3783

Cannot determine VOL(*SAVVOL) location. No objects restored.

CPF3784

Restore device specified in the DEV parameter does not match VOL(*SAVVOL) device.

CPF3785

Not all subsystems ended.

CPF3791

While processing &2 &1 in &3, encountered end of file &4.

CPF3793

Machine or ASP storage limit reached.

CPF3794

Save or restore operation ended unsuccessfully.

CPF3796

Storage limit exceeded for user profile &4.

CPF37A5

RSTASP &1 is not online.

CPF380E

User profile &1 not restored. Not able to create UID or GID.

CPF3805

Objects from save file &1 in &2 not restored.

CPF3807

Data decompression error for save file &1 in &2.

CPF3812

Save file &1 in &2 in use.

CPF3818

Starting library &1 not found.

CPF384F

&2 &1 not restored to library &3.

CPF3894

Cancel reply received for message &1.

CPF38A2

ASP device &1 not correct.

CPF38A6

Only one library allowed with specified parameters.

CPF5729

Not able to allocate object &1.

CPF9809

Library &1 cannot be accessed.

CPF9812

File &1 in library &2 not found.

CPF9814

Device &1 not found.

CPF9820

Not authorized to use library &1.

CPF9822

Not authorized to file &1 in library &2.

CPF9825

Not authorized to device &1.

CPF9829

Auxiliary storage pool &1 not found.

CPFB8ED

Device description &1 not correct for operation.

OPT1498

Volume name list exhausted on device &1.

OPT1502

Attempted to process past the end of a multi-volume set.

OPT1605

Media or device error occurred.

*STATUS Messages

CPF3770

No objects saved or restored for library &1.

CPF3773

&1 objects restored. &2 not restored to &4.

Top