MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Usage of HRECOVER.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Wed Feb 01, 2006 9:25 am    Post subject: Usage of HRECOVER. Reply with quote

Hi,

An interviewer asks a question if a dataset accidentally gets delete then how do you get it back. I told the answer "HRECOVER" because I read it somewhere that deleted datasets can be recovered using this TSO command.

So, to practice it out, I first duped a PS file that contains some data and deleted it. Then, I issued HRECOVER command which is failed. I tried out the same thing on a PDS also. But, the result was the same.

Any help please.

PS: I read old postings before I tried out the HRECOVER command. Sad Confused
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
German Castillo
Beginner


Joined: 23 Dec 2005
Posts: 83
Topics: 2
Location: Caracas, Venezuela

PostPosted: Wed Feb 01, 2006 9:44 am    Post subject: Reply with quote

Hello mf_user

This question may belong to another forum, anyway here it goes

If you delete a dataset and you do not happen to have a backup you are lost. The reason is simple, you do not only happen to have deleted the dataset itself, but its CATALOG entry as well, furthermore in the elapsed time you want to do something the same space previously allocated could be re-allocated to another file, there is nothing to prevent that fact.

If you only 'UNCATALOG' the dataset you may still recover it IF you happen to know the volumen where it was allocated into AND your SMS doesn't wipe it out. This could be done easyly by just RE-CATALOGING the dataset.

Whith that said, HXXXXXX CMDs are sent over to HSM, or extrenal third party dasd management tools they are meant to recover, or recal datasets from Archive or migrate status which are another very different state than a 'deleted' one.
_________________
Best wishes,

German Castillo
Back to top
View user's profile Send private message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Wed Feb 01, 2006 9:52 am    Post subject: Reply with quote

German Castillo,

Thanks for detailed explanation & thank you very much for clearing the doubts on HRECOVER. I misunderstood the purpose of HRECOVER, I believe.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Wed Feb 01, 2006 9:57 am    Post subject: Reply with quote

mf_user,

Here is some more info on HRECOVER

Code:

   Function - Recover a data set from a backup version
               or restore a data set from a dump copy

     Note:  Your data set may be restored from a dump copy rather
     than recovered from a backup version.  This will happen if
     the data set was on a volume that was dumped by DFSMShsm more
     recently than it was backed up by DFSMShsm, and if the class(es)
     to which the volume was dumped allow the restore of a data set
     from a dump copy, and if you do not specify GENERATION or
     VERSION.

     Specifying GENERATION or VERSION will cause the recover to
     be done from a backup version, not a dump copy.  Specifying
     GENERATION(0) will insure that the recovery is done from the
     most recent available backup version.

     Note:  You cannot recover the backup versions of a cataloged data
     set that is currently migrated, as specified in the computing
     system catalog or the MCDS, until DFSMShsm recalls or deletes
     the migrated data set.

   Syntax -
     HRECOVER (dsname/password...)
              EXTENDRC
              FROMVOLUME(volid)
              GENERATION(gennum) or DATE(date) or VERSION(vernum)
              NEWNAME(newdsname/password)
              REPLACE
              TOVOLUME(volid) UNIT(unittype)
              WAIT or NOWAIT

     ALIAS - HRECOV
     REQUIRED - dsname, FROMVOLUME if data set was uncataloged at
                         the time of backup.
     DEFAULTS - NOWAIT
     Example 1
       HRECOVER CL.TEXT/WRITE FROMVOLUME(VOL003) +
               DATE(1984/01/05) NEWNAME(VER1TEXT.TEXT) +
               TOVOLUME(VOL001) UNIT(3330-1) WAIT
     Example 2
       HRECOVER PARTSTST.CNTL TOVOLUME(VOL007) UNIT(3350) REPLACE
     Example 3
       HRECOVER OUTTESTS.TESTLIST GENERATION(2) WAIT EXTENDRC

   Operands -
   DSNAME (dsname/password...) is a required positional parameter
     you use to specify the name of the data set or list of names
     of data sets to be recovered.  If the data set is protected
     by a password, you must supply the password.  Password
     protection does not apply to SMS-managed data sets.  For 'dsname',
     substitute the name of the data set or list of names of the
     data sets that you want to recover.  You can use a data-set
     filter, or a fully qualified alias, for any dsname in a list.
     If you specify a list of data sets or one or more filters,
     each data set is associated with the other parameters
     specified with the command.
     Parentheses are not necessary if a single data set is specified.
     For information on passwords and RACF security requirements,
     type HELP HRECOVER OPER(SECURITY).

   EXTENDRC - specifies that DFSMShsm will return a return code
     and reason code to your CLIST or batch TSO job
     (job that executes the program IKJEFT01).
     The &LASTCC control variable (in the case of a CLIST)
     or register 15 (in the case of a batch TSO job)
     will contain the return code in the high-order two bytes
     and the reason code in the low-order two bytes.
     Notes:
     This option is only appropriate when the command is issued
     in a CLIST or TSO batch job, and when the WAIT option is
     also specified.

   FROMVOLUME(volid) is an optional parameter you use to
     specify that a data set was uncataloged and that it resided
     on the volume specified by 'volid' when DFSMShsm created the
     backup version.  You must use the FROMVOLUME parameter to
     recover a backup version of a data set if the data set was
     uncataloged at the time DFSMShsm backed it up.  You cannot use
     the FROMVOLUME parameter for cataloged data sets.  When you
     specify the FROMVOLUME parameter, DFSMShsm does not catalog the
     recovered backup version.

   GENERATION(gennum) specifies that you want to recover a
     particular backup version of a specific data set.  For
     'gennum', substitute the relative generation number of the
     backup version of the data set that you want to recover.
     Zero is the most recent backup version, 1 is the next to
     the latest version, and so forth, up to the maximum
     number of versions existing for the data set.  If you do not
     specify GENERATION, DATE or VERSION, DFSMShsm recovers the
     most recent backup version of the data set.

     Specifying GENERATION will cause the recover to be done from
     a backup version, not a dump copy.  Specifying GENERATION(0)
     will insure that the recovery is done from the most recent
     available backup version.

   DATE  specifies that you want to recover the latest backup
     version created on or before a particular date.  For 'date',
     substitute the date in the following format for the backup
     version of the data set that you want to recover.

      o yy/mm/dd or mm/dd/yy, if you issue the command before
        1 January 2000.
      o yyyy/mm/dd, if you issue the command after 31 December 1999

     The backup version to be recovered is the newest one created on
     or before the date specified.  You do not have to specify a
     leading zero for a 1-digit month or day.  If you do not
     specify GENERATION, DATE or VERSION, DFSMShsm recovers the
     latest created backup version of the data set.  If you issue
     the command before 1 January 2000 and specify the date in the
     form mm/dd/yy, and do not specify the year (yy), the year
     defaults to the current year.

   VERSION(vernum) specifies that you want to recover a
     particular backup version of a specific data set.  For
     'vernum', substitute the particular version number of the
     backup version of the data set that you want to recover.
     If you do not specify GENERATION, DATE or VERSION,
     DFSMShsm recovers the most recent backup version of the
     data set.

     Specifying VERSION will cause the recover to be done from
     a backup version, not a dump copy.

   NEWNAME(newdsname/password)  is an optional parameter you
     use to specify a new data set name for the recovered backup
     version of the data set.  For 'newdsname', substitute the
     name to be given to the recovered data set.  If a data set
     already exists with the same name as the new name you are
     specifying, you must specify the REPLACE parameter to replace
     the existing data set.  For 'password', substitute the
     correct password and include the preceding slash (/).
     Password protection does not apply to SMS-managed data sets.
     For information on passwords and RACF security requirements
     for the NEWNAME data set, type HELP HRECOVER OPER(NEWSECURITY).

   REPLACE is an optional parameter you use to specify that
     the recovered backup version of a data set is to replace
     any existing data set with the same data set name on the
     receiving volume or on any volume if the data set is
     cataloged.  If you specify NEWNAME and the new name is the
     same as the name of an existing data set, you must specify
     the REPLACE parameter or DFSMShsm does not process the HRECOVER
     command for that data set.  The data set being replaced is
     uncataloged (if it was cataloged) and scratched.  The data
     set to be replaced must have the same data set organization
     as the data set from which the backup version was made (both
     must be VSAM or both must be non-VSAM).

   TOVOLUME(volid) is an optional parameter you use to specify
     the volume that is to receive a recovered data set.  For
     'volid', substitute the serial number of the volume that you
     want to receive the recovered data set.  If you do not
     specify TOVOLUME, DFSMShsm recovers the backup version to the
     volume where the catalog entry specifies the data set
     currently exists or, if no catalog entry exists, to the
     volume where it resided at the time DFSMShsm backed it up.  If
     you specify TOVOLUME, you must also specify UNIT(unittype).
     Notes:
     The TOVOLUME parameter is ignored when the data set is SMS
     managed.

     If you are recovering a VSAM data set cataloged in a non-ICF
     catalog, you can only specify with the TOVOLUME parameter a
     volume owned by the catalog where the VSAM data set being
     recovered is cataloged or will be cataloged.  The volume you
     specify for TOVOLUME cannot be a migration volume.

   UNIT(unittype) is an optional parameter you use to specify
     the type of unit where the receiving volume can be allocated.
     For 'unittype', substitute the type of unit where the volume
     that is to receive the recovered data set can be allocated.
     The valid types of units are: 3330, 3330-1, 3330V, 3350,
     3375, 3380, 3390, and 9345. If you specify UNIT, you must
     also specify VOLUME. The UNIT parameter is ignored when the
     data set is SMS managed.

   WAIT specifies that you want to wait for the HRECOVER
     command to complete.  The default is NOWAIT.

   NOWAIT specifies that you do not want to wait for the
     HRECOVER command to complete.  The default is NOWAIT.

   SECURITY - If you want to recover a RACF-protected data set
     and you issue the HRECOVER command without the NEWNAME
     parameter, you must have RACF ALTER authority to the data
     set.  If you want to recover a RACF-protected data set and
     you issue the HRECOVER command with the NEWNAME parameter,
     you must have RACF READ authority for the data set.  In
     addition, if the new name data set exists and is
     RACF-protected, you must have RACF ALTER authority for the
     new name data set.

     For a password-protected non-VSAM data set, supply the
     password that allows you to write to the data set.  For a
     password-protected VSAM data set: If the data set exists, you
     must supply the current master password of the base
     cluster.  If the data set does not exist, you must supply the
     master password of the base cluster that existed when DFSMShsm
     backed up the data set.

   NEWSECURITY - If a password-protected non-VSAM data set
     currently exists with the name specified by NEWNAME, you must
     supply the password that allows you to write to the data set.
     If a password-protected VSAM data set currently exists with
     the name specified by NEWNAME, you must supply the master
     password of the base cluster.

     If the NEWNAME data set exists and is RACF-protected, you
     must have RACF ALTER authority to the new name data set.

     If you are recovering a RACF-protected data set, the RACF
     profile for the old data set must exist because RACF security
     checking is performed for the old and new data set names.



Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Wed Feb 01, 2006 10:06 am    Post subject: Reply with quote

Thanks Kolusu. That was really very good info.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group