Where allowed to run: All environments (*ALL) Threadsafe: No |
Parameters Examples Error messages |
The Save/Restore Object (SAVRSTOBJ) command saves and restores a single object, or a group of objects located in the same library, to another system. The objects can be restored to the same library or a different library. The types of objects that can be saved and restored are the same set of objects allowed on the Save Object (SAVOBJ) command. Objects on the system from which the objects are being saved are not affected by the SAVRSTOBJ command.
For job queues, message queues, and logical files, only the object descriptions are saved and restored, not the contents. Logical file access paths can be saved and restored by specifying ACCPTH(*YES). The contents of a save file can be saved and restored by specifying SAVFDTA(*YES). The contents of spooled files on output queues can be saved and restored by specifying SPLFDTA(*ALL). The contents of a data queue can be saved and restored by specifying QDTA(*DTAQ).
Note: This command ignores all file overrides currently in effect for the job.
Restrictions:
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
OBJ | Objects | Single values: *ALL Other values (up to 300 repetitions): Generic name, name |
Required, Positional 1 |
LIB | Saved library | Single values: *ALLUSR Other values (up to 300 repetitions): Generic name, name |
Required, Positional 2 |
RMTLOCNAME | Remote location name | Name | Required, Positional 3 |
OBJTYPE | Object types | Single values: *ALL Other values (up to 69 repetitions): *ALRTBL, *BNDDIR, *CHTFMT, *CLD, *CLS, *CMD, *CRG, *CRQD, *CSI, *CSPMAP, *CSPTBL, *DTAARA, *DTAQ, *EDTD, *EXITRG, *FCT, *FILE, *FNTRSC, *FNTTBL, *FORMDF, *FTR, *GSS, *IGCDCT, *IGCSRT, *IGCTBL, *IMGCLG, *JOBD, *JOBQ, *JOBSCD, *JRN, *JRNRCV, *LOCALE, *MEDDFN, *MENU, *MGTCOL, *MODULE, *MSGF, *MSGQ, *NODGRP, *NODL, *ORTBL, *OUTQ, *OVL, *PAGDFN, *PAGSEG, *PDFMAP, *PDG, *PGM, *PNLGRP, *PRDAVL, *PRTIMG, *PSFCFG, *QMFORM, *QMQRY, *QRYDFN, *RCT, *SBSD, *SCHIDX, *SPADCT, *SQLPKG, *SQLUDT, *SRVPGM, *SSND, *SVRSTG, *S36, *TBL, *USRIDX, *TIMZON, *USRQ, *USRSPC, *VLDL, *WSCST |
Optional |
STRLIB | Starting library | Name, *FIRST | Optional |
OMITLIB | Libraries to omit | Single values: *NONE Other values (up to 300 repetitions): Generic name, name |
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, *ALL, *NONE | ||
Qualifier 2: Library | Generic name, name, *ALL | ||
Element 2: Object type | Character value, *ALL, *ALRTBL, *BNDDIR, *CHTFMT, *CLD, *CLS, *CMD, *CRG, *CRQD, *CSI, *CSPMAP, *CSPTBL, *DTAARA, *DTAQ, *EDTD, *EXITRG, *FCT, *FILE, *FNTRSC, *FNTTBL, *FORMDF, *FTR, *GSS, *IGCDCT, *IGCSRT, *IGCTBL, *JOBD, *JOBQ, *JOBSCD, *JRN, *JRNRCV, *LOCALE, *MEDDFN, *MENU, *MGTCOL, *MODULE, *MSGF, *MSGQ, *M36, *M36CFG, *NODGRP, *NODL, *ORTBL, *OUTQ, *OVL, *PAGDFN, *PAGSEG, *PDFMAP, *PDG, *PGM, *PNLGRP, *PRDAVL, *PSFCFG, *QMFORM, *QMQRY, *QRYDFN, *RCT, *SBSD, *SCHIDX, *SPADCT, *SQLPKG, *SQLUDT, *SRVPGM, *SSND, *SVRSTG, *S36, *TBL, *USRIDX, *TIMZON, *USRQ, *USRSPC, *VLDL, *WSCST | ||
ASPDEV | ASP device | Name, *, *SYSBAS, *CURASPGRP | Optional |
TGTRLS | Target release | Simple name, *CURRENT, *PRV | Optional |
PRECHK | Object pre-check | *NO, *YES | Optional |
SAVACT | Save active | *NO, *LIB, *SYSDFN | Optional |
SAVACTWAIT | Save active wait time | Element list | Optional |
Element 1: Object locks | 0-99999, 120, *NOMAX | ||
Element 2: Pending record changes | 0-99999, *LOCKWAIT, *NOCMTBDY, *NOMAX | ||
Element 3: Other pending changes | 0-99999, *LOCKWAIT, *NOMAX | ||
SAVACTMSGQ | Save active message queue | Qualified object name | Optional |
Qualifier 1: Save active message queue | Name, *NONE, *WRKSTN | ||
Qualifier 2: Library | Name, *LIBL, *CURLIB | ||
FILEMBR | File member | Values (up to 300 repetitions): Element list | Optional |
Element 1: File | Name, *ALL | ||
Element 2: Member |
Single values: *ALL, *NONE Other values (up to 50 repetitions): Generic name, name |
||
ACCPTH | Save access paths | *SYSVAL, *NO, *YES | Optional |
SAVFDTA | Save file data | *YES, *NO | Optional |
SPLFDTA | Spooled file data | *NONE, *ALL | Optional |
QDTA | Queue data | *NONE, *DTAQ | Optional |
STG | Storage | *KEEP, *FREE | Optional |
OPTION | Option | *ALL, *NEW, *OLD, *FREE | Optional |
MBROPT | Data base member option | *MATCH, *ALL, *NEW, *OLD | Optional |
ALWOBJDIF | Allow object differences | Single values: *NONE, *ALL Other values (up to 4 repetitions): *AUTL, *FILELVL, *OWNER, *PGP |
Optional |
RSTLIB | Restore to library | Name, *LIB | Optional |
RSTASPDEV | Restore to ASP device | Name, *SAVASPDEV | Optional |
RSTASP | Restore to ASP number | 1-32, *SAVASP | 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 |
Top |
Specifies the names of one or more objects or the generic name of each group of objects to be saved. All the objects must be in the library specified for the Library (LIB) parameter. If *ALL is specified or defaulted for the Object types (OBJTYPE) parameter, all the object types listed in the description of that parameter are saved, provided they are in the specified library and have the specified names.
This is a required parameter.
Single values
Other values (up to 300 repetitions)
Top |
Specifies the library containing the objects to be saved and restored.
Single values
#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 saved and 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
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.
Other values (up to 300 repetitions)
Top |
Specifies the remote location to connect with. Specify the remote location name using the format cccccccc or nnnnnnnn.cccccccc, where nnnnnnnn is the network identifier (ID) and cccccccc is the remote location name.
Top |
Specifies the types of system objects to be saved.
Single values
Other values (up to 300 repetitions)
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 |
Specifies the library with which to begin the save operation.
If an unrecoverable media error occurs during the save operation, this parameter can be used to restart the operation.
The basic steps for restarting a save operation are:
STRLIB(library-name) OMITLIB(library-name)
where the library-name for the STRLIB and OMITLIB parameters is the last library successfully saved. This starts the save operation on the library after the last successfully saved library.
To restore the libraries, you will need to perform a separate restore operation for each save operation that was performed.
Top |
Specifies the names of one of more libraries, or the generic names of each group of libraries, to be excluded from the save operation.
Single values
Other values (up to 300 repetitions)
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 |
Specifies the auxiliary storage pool (ASP) device to be included in the save operation. This parameter is used to subset the list of objects which qualify for the SAV based on the OBJ parameter.
Top |
Specifies the release level of the operating system on which you intend to use the object being saved.
When specifying the target-release value, the format VxRxMx is used to specify the release, where Vx is the version, Rx is the release, and Mx is the modification level. For example, V5R3M0 is version 5, release 3, modification 0.
Valid values depend on the current version, release, and modification level of the operating system, and they change with each new release. You can press F4 while prompting this command parameter to see a list of valid target release values.
Top |
Specifies whether the save operation for a library ends if any of the following are true:
Top |
Specifies whether an object can be updated while it is being saved.
Note: If your system is in a restricted state and the SAVACT parameter is specified, the save operation is performed as if SAVACT(*NO) was specified.
Top |
Specifies the amount of time to wait for an object that is in use, or for transactions with pending changes to reach a commit boundary, before continuing the save operation.
Element 1: Object locks
For each object that is in use, specifies the amount of time to wait for the object to become available. If an object remains in use for the specified time, the object is not saved.
Element 2: Pending record changes
For each group of objects that are checkpointed together, specifies the amount of time to wait for transactions with pending record changes to reach a commit boundary. The Save active (SAVACT) parameter determines which objects are checkpointed together. If 0 is specified, all objects being saved must be at commit boundaries. If any other value is specified, all objects that are journaled to the same journals as the objects being saved must reach commit boundaries. If a commit boundary is not reached in the specified time, the save operation is ended, unless the value *NOCMTBDY is specified.
If you restore an object that was saved with partial transactions, you cannot use the object until you apply or remove journal changes (APYJRNCHG or RMVJRNCHG command) to reach commit boundaries. You will need all journal receivers that contain information about the partial transactions to apply or remove the changes. Until you apply or remove the changes, any future save of that object will include the partial transactions, even if you do not specify *NOCMTBDY.
Note: This value cannot be specified if the Target release (TGTRLS) parameter value is earlier than V5R3M0.
Element 3: Other pending changes
For each library, specifies the amount of time to wait for transactions with other pending changes to reach a commit boundary. Other pending changes include the following:
If a commit boundary is not reached for a library in the specified time, the library is not saved.
Top |
Specifies the message queue that the save operation uses to notify the user that the checkpoint processing for a library is complete. A separate message is sent for each library to be saved when the *SYSDFN or *LIB value is specified for the Save active (SAVACT) parameter. When *SYNCLIB is specified for the SAVACT parameter, one message is sent for all libraries in the save operation.
This parameter can be used to save the objects at a known, consistent boundary to avoid additional recovery procedures following a restore operation. Applications can be stopped until the checkpoint processing complete message is received.
Single values
Qualifier 1: Save active message queue
Qualifier 2: Library
Top |
Specifies the database file members that are saved. This parameter is made up of two parts: the file name and the member name.
Each database file specified here must also be specified for the Objects (OBJ) parameter, by its complete name, a generic name, or *ALL. The Object types (OBJTYPE) parameter value must be *ALL or include *FILE.
Note: This parameter cannot be specified when STG(*FREE) is specified.
Element 1: File
Note: Generic names are not valid for the database file name, but are allowed for the member name.
Note: Duplicate file names are not allowed.
Element 2: Member
Single values
Other values (up to 50 repetitions)
Note: If generic member names are specified, the file must contain member names that match the generic names for the file to be saved. For example, if PAY* is specified as a generic member name, and the system is unable to find a member whose name starts with PAY, the file is not saved. If files specified by the FILEMBR parameter are not saved because members with the specified generic name cannot be found, a diagnostic message is sent, the save operation ends, and an escape message is sent specifying the number of files not saved. If at least one of the files processed for the FILEMBR parameter contains a member with the specified generic name, the diagnostic message is not sent, and the number of files not saved is in the final completion message.
Note: If specific member names are specified, the specified members must exist in the file for any part of the file to be saved or restored.
Top |
Specifies whether the logical file access paths that are dependent on the physical files being saved are also saved. The access paths are saved only in the case of the following:
The system checks to ensure the integrity of the access paths. Any discrepancies found by the system will result in the access paths being rebuilt.
Informational messages are sent indicating the number of logical file access paths saved with each physical file. All physical files on which an access path is built must be in the same library. This parameter does not save logical file objects; it only controls the saving of the access paths. More information on the restoring of saved access paths is in the Backup and Recovery book, SC41-5304.
ATTENTION: If the based-on physical files and the logical files are in different libraries, the access paths are saved. However, if the logical files and the based-on physical files are in different libraries and the logical files or physical files do not exist at restore time (such as during disaster recovery or the files were deleted) the access paths are not restored. They are rebuilt. For the fastest possible restore operation for logical files, the logical files and the based-on physical files must be in the same library and must be saved at the same time.
Note: Specifying this value does not save the logical files.
Top |
Specifies, for save file objects, whether the description of a save file, or both the description and the contents of a save file, are saved.
Top |
Specifies whether to save spooled file data and attributes for output queues that are saved.
Top |
Specifies, for queue objects, whether the description of a queue, or both the description and the contents of a queue, are saved.
Top |
Specifies whether the system storage that is occupied by the data portion of the specified members (except for save files), modules, programs, service programs, Structured Query Language (SQL) packages, and journal receivers in the library being saved is freed as part of the save operation. Only the data portion of the objects is freed, not the descriptions of the objects.
Note: To prevent the possible abnormal end of a program, the program being saved must not be running in the system when *FREE is specified.
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 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 the library in which the objects are to be 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 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 |
Example 1: Saving and Restoring Generic Objects
SAVRSTOBJ OBJ(ABCD*) LIB(ACE) RMTLOCNAME(SYSTEM1) OBJTYPE(*PGM) ALWOBJDIF(*NONE)
This command saves the objects beginning with the characters ABCD located in the library named ACE and restores them on the remote system named SYSTEM1.
Example 2: Saving and Restoring a Specific Object
SAVRSTOBJ OBJ(FLETCH) LIB(CHASE) RMTLOCNAME(SYSTEM1) ALWOBJDIF(*ALL) OPTION(*NEW)
This command saves the object named FLETCH located in the library named CHASE and restores it on the remote system named SYSTEM1 if it is does not already exist on the remote system.
Top |
*ESCAPE Messages
Top |