LISTDSN and RESTDSN Examples
The CLI can be used to identify and restore data sets or voluinstancesmes, according to a specific search criteria. Following are some examples.
SCENARIO A: COMPARING BETWEEN DIFFERENT VERSIONS OF A DATA SET
A programmer wants to restore a previous version of a source member in order to compare between the current and the previous version of his code. The development data sets are backed up only if they were changed since the last backup. The backup is incremental, the last 3 changes are kept. The data set is restored with a new name and cataloged, to allow easy allocation for the compare operation.
The RESTDSN command will be as follows:
1
TSO M9CLI RESTDSN M9.USER.SOURCE NEWNAME(M9.USER.SOURCE.PREVIOUS)
Copied!
The command will restore the latest version of the data set, marked in the output as ENTRY(0).
SCENARIO B: RECOVERY FROM ACCIDENTAL DELETION OF A DATA SET
A data set is accidently deleted. The system administrator needs the latest copy, and therefore performs a LISTDSN to verify and then performs a quick RESTDSN. The latest copy is restored from a full volume dump.
The RESTDSN command will be as follows:
1
TSO M9CLI RESTDSN SYS2.PROCLIB
Copied!
The data set will be restored from the latest copy, in this case from a volume’s full dump copy. Because the origin was a volume full dump, the LISTDSN output did not show whether this data set was cataloged during backup. Nevertheless, the RESTDSN command will catalog it automatically, unless specified otherwise.
SCENARIO C: RECOVERY FROM A CORRUPTED SYSTEM DATA SET DURING IPL
When IPL-ing the system, z/OS does not initialize correctly because of an invalid member of SYS1.PARMLIB. The data set is accessible from a different system, where it is not cataloged. It shows that the member in question was changed on the 28/06/2019. In order to restore the data set to a version before that specific change that corrupted it, LISTDSN is used to list all the backup copies of SYS1.PARMLIB on a specific volume, within a specific date range:
The data set can be restored in one of several ways. Note that RESTDSN command catalogs the data set by default - no matter whether it was cataloged on the restoring system or not:
  1. 1.
    Using the same command used for LISTDSN, adding the requested ENTRY:
    1
    M9CLI RESTDSN SYS1.PARMLIB VOL(M9RES1) DATER(2019/06/30-2019/06/01) ENTRY(2) NOCAT
    Copied!
  2. 2.
    Using the RESTDSN command with a specific DATE. The command will restore the latest backup copy created on that day:
    1
    M9CLI RESTDSN SYS1.PARMLIB VOL(M9RES1) DATE(2019/06/26) NOCAT
    Copied!
  3. 3.
    Using the RESTDSN with the UNIQUEID parameter:
    1
    M9CLI RESTDSN SYS1.PARMLIB VOL(M9RES1) UNIQUEID(F9E717CE) NOCAT
    Copied!
SCENARIO D: RECOVERY AT A THIRD PARTY’S REMOTE SITE
The object storage containing the site’s backups is replicated daily to a remote site. The remote site belongs to a third party that supplies recovery services. In case of data corruption on the primary site, the corrupted data set can be recovered on the third party’s host and sent back to the primary site. There is no SMS active on the third party’s site, the data set is restored with NULLMC, NULLSC and BYPASSACS:
1
M9CLI RESTDSN M9.APPL.LOAD NEWVOL(OUTS01) NULLMC NULLSC BYPASSACS
Copied!
Last modified 1mo ago
Export as PDF
Copy link