REGENERATE ONEPASS command

From m204wiki
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Summary

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

Syntax

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

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

Where: REGENERATE ONEPASS processing runs only Pass One through the CCAGEN data set.

REGENERATE ONEPASS is significantly faster than REGENERATE but cannot be used across recovery runs or discontinuities (such as file create or delete).

If you must regenerate across a recovery process, two passes of the journal are required. You must build REGENERATE commands, not REGENERATE ONEPASS commands, which are invalid.

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

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

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

    • If a FROM clause is not present for a file, REGENERATE ONEPASS 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.

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

    TO clause options

    Option

    Applies updates to the file up to...

    LAST UPDATE

    All. This is the default.

    UPDATE nn OF yy.ddd hh:mm:ss.th

    And including the update specified by number and date-timestamp.

    CHECKPOINT yy.ddd hh:mm:ss.th

    Specified checkpoint with a date-timestamp.

Syntax notes

When you regenerate multiple files, you must specify each file on a separate line. The line can begin in any column. The END command indicates the end of the list of files.

Examples

REGENERATE ONEPASS FILE DB1 FROM DUMPDB1 REGEN ONEPASS FILE DB1 FROM DUMPDB1 TO LAST UPDATE REGEN ONEPASS FILE DB1 FROM DUMPDB2 TO UPDATE 3 OF 13.116 10:15:25.00 REGEN ONEPASS FILE MODFILE FROM DUMPMOD TO - CHECKPOINT 13.116 01:05:22.99 REGEN ONEPASS FILE DB1 FROM DUMPDB1 TO CHECKPOINT - 13.116 11:44:30.15 FILE DB2 FROM DUMPDB2 FILE DB3 FROM DUMPDB3 TO UPDATE 5 OF 13.116 14:32:22.00 END

Usage notes

Note: The TO clause options for a REGENERATE ONEPASS command are restricted in scope when compared to the REGENERATE command, because no stopping point is known without reading the entire CCAGEN data set. (See the REGENERATE command.)

An incorrect TO clause generates the following error message.

M204.1410: REGENERATE COMMAND REJECTED

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

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

When processing REGENERATE ONEPASS, Model 204 ends any update unit in progress and begins an update unit that cannot be backed out. For more information about Model 204 update units, see Update units and transactions.

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

Using the TO UPDATE option

You can specify the TO UPDATE option for a single or multiple file run.

If TO UPDATE nn OF id is specified, it must appear only on the first FILE statement, and no other ‘TO’ options are allowed on subsequent files.

(In Model 204 version 7.6, the new message: M204:1664 "TO UPDATE" only allowed on first line of REGENerate appears any time more than one TO UPDATE is specified, or if TO UPDATE is specified on a line other than the first.)

All additional files are recovered as though they each specified the same 'TO UPDATE' option. The id' timestamp is the END OF TRANSACTION timestamp. Once the 'end of transaction' is reached, further processing stops, all inflight transactions are backed out, and RC=0 is set.

If the update is not found in the journal:

  • The run only stops at the end with all updates applied (as if no TO option had been specified). This is because each update is applied until the stopping point is found. Since no stopping point was found, ONEPASS continues until the end and only reports the problem for each file as: M204.1409: MISSING STOPPING POINT FOR FILE filename.
  • RC=4 is set.