REGENERATE command

From m204wiki
Revision as of 21:15, 11 February 2014 by ELowell (talk | contribs) (→‎Syntax)
Jump to navigation Jump to search

Summary

Privileges
User 0
Function
In the event of a media failure, for example, a disk head crash, a REGENERATE command recovers a Model 204 file by reapplying some or all of the updates that have been made to the file since the time of the last dump.

Syntax

REGENERATE FILE filename [FROM dumpname | IGNORE] [TO {LAST UPDATE [BEFORE yy.ddd hh:mm:ss.th] | LAST CHECKPOINT [BEFORE yy.dd hh:mm:ss.th] | UPDATE nn OF yy.ddd hh:mm:ss.th | CHECKPOINT yy.ddd hh:mm:ss.th}]

For more than one file, specify REGENERATE only once; the remaining syntax is repeated for each file.

Where:

  • filename is the name of a Model 204 file that is one to eight characters long.

  • A FROM clause determines whether or not REGENERATE processing performs a restore:

    • If a FROM clause is present for a file, REGENERATE processing restores that file from the Model 204 dump specified in the clause.

    • If a FROM clause is not present for a file, REGENERATE processing assumes that the file was previously restored.

  • dumpname is the ddname of the dumped file, one to eight characters long, from which to recover.

  • IGNORE lets REGENERATE processing bypass the file parameter list (FPL) update timestamps, so you can run REGEN processing with one CCAGEN at a time, instead of requiring you to concatenate the CCAGEN files.

  • The TO clause options listed in the table below identify the stopping point:

    Option

    Applies updates to the file up to...

    LAST UPDATE

    All. This is the default.

    LAST CHECKPOINT

    Last checkpoint on the input journal.

    UPDATE number [OF id]

    And including the specified update. The ID, which is the date/time stamp from the END OF UPDATE message, is specified in the form: yy.ddd hh:mm:ss.th.

    CHECKPOINT id

    Specified checkpoint. The ID is specified in the form: yy.ddd hh:mm:ss.th.

  • A BEFORE clause specifies a nonspecific stopping point. The BEFORE clause is an alternative to specifying an exact checkpoint ID or update unit number and ending date and time from an audit trail.

    If you specify a BEFORE clause, Pass One of REGENERATE processing determines the last complete update or checkpoint before the time specified. Pass Two of REGENERATE processing stops reapplying file updates when it reaches the stopping point identified in Pass One.

Syntax notes

When multiple files are regenerated, each file must be specified on a separate line. The line can begin in any column. The END keyword indicates the end of the list of files.

Examples

REGENERATE FILE DB1 FROM DUMPDB1 REGEN FILE DB1 FROM DUMPDB1 TO LAST UPDATE REGEN FILE DBAUDIT FROM DUMP01 TO LAST - CHECKPOINT REGEN FILE DB1 FROM DUMPDB2 TO UPDATE 3 - OF 88.216 06:28:42.98 REGEN FILE MODFILE FROM DUMPMOD TO - CHECKPOINT 88.216 01:05:22.99 REGEN FILE DB1 FROM DUMPDB1 TO LAST CHECKPOINT FILE DB2 FROM DUMPDB2 FILE DB3 FROM DUMPDB3 TO UPDATE 5 OF - 88.008 05:19:41.27 END

Note: Blank lines are not valid between the REGENERATE and END command.

REGEN FILE ABC FROM DUMPABC /* First run */ . . REGEN FILE ABC IGNORE /* A later run */

Usage notes

The REGENERATE command lets the system manager use the Model 204 media recovery feature to regenerate one or more files. A REGENERATE command is issued in case of a loss of storage integrity caused by a hard system error such as a disk head crash.

The algorithm for identifying starting points, used whether or not a FROM clause is present, is to find the first start of an update unit with a time greater than the last updated time of the file being processed.

If REGENERATE processing opens a file for which it is not performing a restore, and if that file is marked physically inconsistent, REGENERATE processing for that file is discontinued.

When it processes REGENERATE, Model 204 ends any update unit in progress and begins a no-back out-allowed update unit. For more information about Model 204 update units, see Update units and transactions.

For a single-user (batch) Model 204 run, specify a REGENERATE command on User 0's command line. REGENERATE need not be the first command issued. You can intermix User Language procedures and other batch functions with REGENERATE commands.

Using the IGNORE option

For example, providing the first journal the first REGEN command might be

REGEN FILE ABC FROM DUMPABC

A second run may provide the second journal and specify:

REGEN FILE ABC IGNORE

The second run begins where the previous REGEN processing ended and applies the second journal updates.

Note: If you omit a journal, Model 204 does not report this to you. Therefore, use the IGNORE option with care.

Using REGENERATE with multiple files

The number of files you can regenerate in a single run depends upon the settings of these parameters: NDIR (number of directory entries) and NFILES (number of file areas).