RECOVERY Command (RECOVERY)

The RECOVERY command requests that ddb perform a database recovery. All applicable RECBASE and RECJOB commands must immediately precede this command.
datacom
The RECOVERY command requests that
CA Datacom®/DB
perform a database recovery. All applicable RECBASE and RECJOB commands must immediately precede this command.
The following topics are discussed on this page:
Backward Recovery
►►─ RECOVERY OPTION=BACKWARD ─┬───────────────────────┬───────────────────────► └─ ,INDEX= ─┬─ YES ◄ ─┬─┘ └─ NO ────┘ ►─ ,MISMATCH= ─┬─ FAIL ───┬─┬─────────────┬─┬─────────────────────────┬──────► └─ IGNORE ─┘ └─ ,NUMBER=
n
─┘ └─ ,OPTION1= ─┬─ NOF ◄ ─┬─┘ ├─ '(I)' ─┤ └─ '(U)' ─┘ ►─┬─────────────────────────┬─┬────────────────────┬─┬─────────────┬─────────► └─ ,REPORT= ─┬─ ALL ◄ ──┬─┘ └─ ,SORT= ─┬─ 0 ◄ ─┬─┘ └─ ,SORTDD=
n
─┘ └─ ERRORS ─┘ └─
n
───┘ ►─┬─────────────┬─┬───────────┬─┬─────────────────┬─┬────────────────┬───────► └─ ,SORTWK=
n
─┘ └─ ,UNIT=
c
─┘ └─ ,TASKID=
nnnnn
─┘ └─ ,TERMID=
cccc
─┘ ►─┬─────────────────┬─┬───────────────────────────┬──────────────────────────► └─ ,TSN=
xxxxxxxx
─┘ └─ RANGEDT=
date/time-range
─┘ ►─┬─────────────────────────────┬─┬─────────────────────┬────────────────────►◄ └─ RANGESC=store-clock
-range
─┘ └─ FORCE= ─┬─ NO ◄ ─┬─┘ └─ YES ──┘
Forward Recovery
►►─ RECOVERY OPTION=FORWARD ─┬───────────────────────┬────────────────────────► └─ ,INDEX= ─┬─ YES ◄ ─┬─┘ └─ NO ────┘ ►─┬─────────────────────────┬─┬────────────────────────┬─────────────────────► └─ ,REPORT= ─┬─ ALL ◄ ──┬─┘ └─ ,UPDATE= ─┬─ YES ◄ ─┬─┘ └─ ERRORS ─┘ └─ NO ────┘ ►─┬───────────────────────────┬─┬─────────────────────────────┬──────────────► └─ RANGEDT=
date/time-range
─┘ └─ RANGESC=store-clock
-range
─┘ ►─┬─────────────────────┬────────┬─────────────────────────────────────────┬─► └─ FORCE= ─┬─ NO ◄ ─┬─┘ └─ ,MULTUSE= ─┬─ NO ◄ ─┬─ ,DBID=
n
,AREA=
a
─┘ └─ YES ──┘ └─ YES ──┘ ►─┬─────────────┬──┬───────────────────────┬─────────────────────────────────►◄ └─ ,NUMBER=
n
─┘ └─ ,RECID= ─┬─ YES ◄ ─┬─┘ └─ NO ────┘
Command
  • RECOVERY
    Invokes the function to rebuild a damaged database.
Required Keyword
  • ,MISMATCH=
    (For backward recovery only.)
    Specify the action the RECOVERY function is to take in the event that the data has been modified since the commit. FAIL means to stop and invoke rollback, while IGNORE means to skip the offending update and continue with the recovery. In both cases, the failing update is not applied to the database.
    A MISMATCH for the specific maintenance commands is defined as follows:
    • Logged DELET Record
      The record is found. For URI areas (recommended), the right URI record is found in the required location (block), or a moved record index (URI index) exists indicating another location where the record is found. For non-URI areas (not recommended), the right record is simply any record found in the required block that currently contains the logical record number (1-255). Sufficient DELET/ADDIT combinations can cause the numbers to be reused when space is reclaimed.
    • Logged UPDAT Record
      First case, the record is not found. Second case, the record found elements mismatch with the elements from the logged UPDAT record. Note that only the elements in the UPDAT command are compared, and if they are equal the update restores only those elements to the before update state.
    • Logged ADDIT Record
      First case, the record is not found. Second case, the record found elements mismatch the elements from the logged ADDIT record. Note that if the elements match, the row is deleted. This takes into account no other fields in the record.
    • Valid Entries:
      FAIL or IGNORE
    • Default Value:
      (No default)
  • OPTION=
    Indicates the type of recovery desired.
    • Valid Entries:
      BACKWARD or FORWARD
    • Default Value:
      (No default)
Optional Keywords
  • ,AREA=
    a
    Specifies the area, where
    a
    is the area name, for area level DBUTLTY control.
    To use area level DBUTLTY control, three keywords must be provided, MULTUSE=YES, DBID=
    n,
    and AREA=
    a.
    The three are a set, that is, if one of the three is specified, the other two must also be specified. When all are provided, the RECBASE and RECJOB functions are not allowed. Using the three area level control keywords, recovery works at the same level as the LOAD, RETIX, INIT, EXTEND, and REORG utility functions.
    For more information on area level DBUTLTY control, see Area Level DBUTLTY Control.
    • Valid Entries:
      DATACOM-NAME of the area in the database specified in the DBID= parameter
    • Default Value:
      (No default)
  • ,DBID=
    n
    Identifies the database containing the area, for area level DBUTLTY control.
    To use area level DBUTLTY control, three keywords must be provided, MULTUSE=YES, DBID=
    n,
    and AREA=
    a.
    The three are a set, that is, if one of the three is specified, the other two must also be specified. When all are provided, the RECBASE and RECJOB functions are not allowed. Using the three area level control keywords, recovery works at the same level as the LOAD, RETIX, INIT, EXTEND, and REORG utility functions.
    For more information on area level DBUTLTY control, see Area Level DBUTLTY Control.
    • Valid Entries:
      DATACOM-ID of the database
    • Default Value:
      (No default)
    For forward recovery only, specifies the device type of the input.
    • Valid Entries:
      DISK or TAPE (Certain values from previous versions are still accepted but are treated as DISK.)
    • Default Value:
      TAPE
  • ,FORCE=
    Specifies whether the recovery utility allows input without the first record being a CYCLE START. The RECOVERY utility expects the input to be a Recovery File (RXX) or a
    CA Datacom®
    Fast Recovery file. It verifies this is correct based upon a control block at the start of the file. Valid entries for FORCE= are NO or YES. The default is NO.
    Specifying FORCE=YES removes the edit and forces the utility to process the input to its best ability. We do not recommend specifying FORCE=YES. The FORCE=YES option exists to allow clients who
    know
    that a recovery
    only needs
    data on a volume or volumes of a multivolume RXX file, not including the first. I/O can thus be saved but at the risk that none or only some of the necessary maintenance is completed.
    When FORCE=NO is specified, the first Recovery File (RXX) presented to recovery must be the first volume of a possibly multivolume data set. This is what recovery expects and what should normally be done.
    If time is important and the risk of doing the wrong recovery is acceptable, you can specify FORCE=YES to allow a non-first volume to start recovery, which can save time if that volume contains the required information.
    A console message written when the Recovery File was built provides only the date/times of the first and last record and does not indicate where within that span most of the data lies. If FORCE=YES is specified, an additional message
    DB13116I RECOVERY FIRST RECORD WITH FORCE, TIME
    is printed on the console, even if a CYCLE START is present.
    Two console messages track the presence of the first volume of a Recovery File and the end of a Recovery File. The message at the start of a Recovery File is
    DB13112I RECOVERY START rrrrr-ccccc.
    The message at the end of a Recovery File is
    DB13113I RECOVERY END rrrrr-ccccc, TIMES ccyy/mm/dd hhmmss-ccyy/mm/dd hhmmss.
    In both messages rrrrr is the Recovery File number and ccccc is the cycle number.
    • Valid Entries:
      NO or YES
    • Default Value:
      NO
  • ,INDEX=
    Specifies whether the index is to be processed during record maintenance. If NO is specified, the RETIX function must be performed for every database processed after the recovery operation.
    • Valid Entries:
      NO or YES
    • Default Value:
      YES
    Specifies the number of input recovery files for forward recovery. Specify as 1 for backward recovery or let default to 1.
    • Valid Entries:
      A 1- to 3-character integer indicating the number of files to read for forward recovery
      1 for backward recovery
    • Default Value:
      1
  • MULTUSE=
    (For area level DBUTLTY control only.)
    For area level DBUTLTY control, three keywords must be provided, MULTUSE=YES, DBID=
    n,
    and AREA=
    a.
    The three are a set, that is, if one of the three is specified, the other two must also be specified. When all are provided, the RECBASE and RECJOB functions are not allowed. Using the three area level control keywords, recovery works at the same level as the LOAD, RETIX, INIT, EXTEND, and REORG utility functions.
    MULTUSE=YES allows a single area in a database to be recovered with no disabling of the other areas in the database. With MULTUSE=YES, the area involved must be able to be opened for update in the MUF. Once begun, the function prevents other opens for the area. Tables in other areas may be open for other utilities and user applications based upon normal rules. This recovery does not add log records. If it fails, it is necessary to restore the data area again and restart the recovery, the same as would be required when running any of the other forms of forward recovery. In forward recovery, if you specify MULTUSE=NO, or allow the function to default to it, the database involved must be able to be opened for update by the utility address space. This means it is not open for update by any other address space, including a MUF. Also, the database should not be open for read, even though
    CA Datacom®/DB
    does allow it. For more information on area level DBUTLTY control, see Area Level DBUTLTY Control.
    • Valid Entries:
      NO or YES
    • Default Value:
      NO
  • ,NUMBER=
    Specifies the maximum number allowed per execution of dumps generated by return code 04(47), received when the record ID in the Request Area contains invalid data or is not in the specified table. For more information on return code 04(47), see Messages.
    Because running forward recovery with UPDATE=NO indicates a
    hot backup,
    all 04(47) dumps are suppressed. They do not normally occur when all is done correctly, but in testing and not running exactly what is needed, many can occur. Usually, if many occur they fill the PXX or PXXML and prevent other useful information from being available. Most often a pattern exists, and two dumps would be plenty to find any real error. The number could be set higher, of course, based upon testing needs or as directed by Support.
  • ,OPTION1=
    Specifies the statistics display option to be passed to the sort program (see the SORT= parameter).
    • NOF
      Corresponds to the NOFLAG parameter of the IBM sort. Only critical messages are to be displayed on the console.
    • '(I)'
      Specifies that informational and critical messages are to be displayed on the printer and the console.
    • '(U)'
      Specifies that only critical messages are to be directed to both the printer and the console.
    NOF, '(I)', and '(U)' correspond to the SyncSort MSG options of CC, SC, and CB respectively. The OPTION1= parameter also accepts any three-character (including the surrounding parentheses) FLAG parameter that can be processed by the IBM sort. See your IBM sort manual for details.
    • Valid Entries:
      NOF or '(I)' or '(U)'
    • Default Value:
      NOF
    Specifies the options for the associated sort/merge program application.
    Values for this keyword must be 44 characters or less, enclosed in quotes. Depending on the features of your installation's sort, the values that apply to this keyword can vary. The system does not edit anything that you place inside of the quotes.
    • Valid Entries:
      Any values your installation's sort allows are valid. These values must be less than 44 characters and be inside quotes.
    • Default Value:
      CRITICAL for PRINT
      LOG for ROUTE
  • ,RANGEDT=
    Specify two date/times to provide a range (lowest to highest times to process). The date/times are specified as a 28 character number with the lower date/time immediately followed by the higher date/time. Each date/time is 14 characters in the format 'ccyymmddhhmmss'. For example: '2001011000000020010228235959'. The input is not read beyond one record higher than this ending value.
    A century and year combination of less than 1998 is not allowed.
    The recovery report detail lines print the date in the format mm/dd/ccyy (see Recovery File (RXX) Analysis Report).
    • cc
      century
      Valid Entries: 19 through 39
      Default Value: (No default)
    • yy
      year
      Valid Entries: 00 through 99
      Default Value: (No default)
    • mm
      month
      Valid Entries: 01 through 12
      Default Value: (No default)
    • dd
      day
      Valid Entries: 01 through 31
      (regardless of month)
      Default Value: (No default)
    • hh
      hour
      Valid Entries: 00 through 23
      Default Value: (No default)
    • mm
      minute
      Valid Entries: 00 through 59
      Default Value: (No default)
    • ss
      second
      Valid Entries: 00 through 59
      Default Value: (No default)
  • ,RANGESC=
    Allows two Store Clock values and will report for all log records between the two times. Normally, you can use RANGEDT. This field can be useful around Daylight Saving Time change. Total value is 32 hexadecimal values where the first 16 are a lower clock value and the second a higher value.
  • ,RECID=
    RECID=NO allows forward recovery to be based on the Master Key instead of on the row identifier.
    Using RECID=NO is for
    special purposes
    as described in the following. RECID=NO is
    not
    for "normal" forward recovery situations.
    Forward recovery requires a database to be in the
    same place and identity
    to execute forward reprocessing successfully. This is not always possible, for example when recovery is associated with the reorganization of a database, which can require closing the database, resulting in an outage of undesirable duration for 24X7 sites.
    RECID=NO, basing forward recovery on the Master Key instead of on the record identifier, can be useful as follows:
    • It allows recovered backups to be physically different than the original image.
    • It can be used when recovery needs to span reorganizations.
    • It can be used to keep duplicate query systems in sync.
    • It can be used with DASD snapshots for offline reorganization.
    To be used successfully, a stable copy of the data in an area must exist in two places. No maintenance must occur at the second location except forward recovery. All maintenance from the primary location must be applied by this RECID=NO forward recovery in ascending order. No mismatch is possible for ADDIT. The command is simply processed. UPDATE and DELET must match byte for byte.
    If you specify RECID=NO,
    hot backups
    do not work. Also, areas must be URI when using RECID=NO. If you specify RECID=NO and areas are not defined as URI, an error occurs and the following message is generated:
    DB13001E UNEXPECTED RETURN CODE rr (iii),
    where the return code (rr) is 94 and the internal return code (iii) is (123).
  • ,REPORT=
    Specify ERRORS to report on
    only
    those records which have errors. Specify ALL to report on
    all
    records which were recovered.
    • Valid Entries:
      ERRORS or ALL
    • Default Value:
      ALL
  • ,SORT=
    Specify this option to speed backward recovery by providing sort a record estimate to sort. That is to say, the value of the SORT= keyword specifies the estimated number of entries to be sorted. DBUTLTY passes the value specified for this parameter to the sort routine. Therefore, the value specified for SORT= can affect the amount of runtime used by the sort, but when you specify any value, including zero, for SORT=, the sort is performed.
    Do
    not
    specify over 99 million unless you verify that the sort package you are using allows a larger number.
  • SORTDD=
    Specifies an optional DD statement, provided to the SORT that redirects SYSPRINT-type output from the SYSPRINT DD (used by DBUTLTY) to this optional DD statement.
    • Valid Entries:
      Printed output directed to optional DD statement
    • Default Value:
      Pinted output directed to SYSPRINT, intermixed with DBUTLTY output
  • ,SORTWK=
    Specifies the number of sort work areas.
    Do not specify a 2-digit number unless the sort package you are using allows a 2-digit number. Sort packages that do not support a 2-digit number can fail in an unpredictable manner, if you specify a 2-digit number.
  • ,UNIT=
    Specifies the unit name for sort work areas.
    • Valid Entries:
      1- to 8-character unit name
    • Default Value:
      SYSDA
  • ,TASKID=
    (For backward recovery and valid for CICS transactions only.)
    Specify that the updates associated with a specific task ID are to be reversed.
    • Valid Entries:
      5-digit number assigned by CICS
    • Default Value:
      (No default)
  • ,TERMID=
    (For backward recovery only.)
    Specify that the updates associated with a specific CICS terminal ID are to be reversed.
    • Valid Entries:
      4-character CICS terminal ID
    • Default Value:
      (No default)
  • ,TSN=
    For backward recovery only, specify the transaction sequence number (TSN) associated with updates needing to be backed out. If the MUF startup option RXXROLLBACK is YES,
    CA Datacom®/DB
    issues a console request (DB00109W) to alert the operator of a failed force spilled transaction and the TSN (in hexadecimal).
    • Valid Entries:
      A hexadecimal value from 00000000 to FFFFFFFF
    • Default Value:
      00000000
  • ,UPDATE=
    For forward recovery only, if the LOAD was done from a safe backup, that is, from a backup database that was not being updated during the backup, you can either specify UPDATE=YES or allow UPDATE= to default to YES. If maintenance was or could have been occurring to the backup database during the LOAD, specify UPDATE=NO.
    Errors are expected after restoring a backup which was taken while the database was open for update and maintenance was occurring, but when the complete forward recovery process is done, the data is correct. When you do not specify UPDATE=NO, each error (mismatch) causes a dump of information to be generated. This causes the amount of output from the recovery to be large. However, dumps are only necessary to help correct problems if the encountered errors are unexpected. Therefore, specifying UPDATE=NO means that you expect errors, that you assume they are going to be correct when forward recovery is complete, and you do not want the dumping of information to occur.
    Only specify UPDATE=NO for the condition described above. Unexpected errors should be allowed to generate dumps. Without the dumps, there is no way to find and correct problems.