REGENERATE command: Difference between revisions
Line 125: | Line 125: | ||
<p>If TO UPDATE <var class="term">nn</var> OF <var class="term">id</var> is specified, it must appear only on the first FILE statement, and no other ‘TO’ options are allowed on subsequent files.</p> | <p>If TO UPDATE <var class="term">nn</var> OF <var class="term">id</var> is specified, it must appear only on the first FILE statement, and no other ‘TO’ options are allowed on subsequent files.</p> | ||
(In Model 204 version 7.6, the new message: <code>M204:1664 "TO UPDATE" only allowed on first line of REGENerate</code> appears any time more than one TO UPDATE is specified, or if TO UPDATE is specified on a line other than the first.) | (In Model 204 version 7.6, the new message: <code>M204:1664 "TO UPDATE" only allowed on first line of REGENerate</code> appears any time more than one TO UPDATE is specified, or if TO UPDATE is specified on a line other than the first.) | ||
<p>All additional files | <p>All additional files are recovered as though they each specified the same 'TO UPDATE' option. The <var class="term">id</var>' 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.</p> | ||
<p>If the update is not found in the journal, then the run stops immediately after pass 1. RC=4 is set. This message is displayed for each file: </p> | <p>If the update is not found in the journal, then the run stops immediately after pass 1. RC=4 is set. This message is displayed for each file: </p> |
Revision as of 20:01, 12 February 2014
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 number 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 update specified by number and id. The ID is the date/time stamp from the END OF UPDATE message, 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 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, then the run stops immediately after pass 1. RC=4 is set. This message is displayed for each file:
M204.1409: MISSING STOPPING POINT FOR FILE filename
And this message is also displayed:
M204.1435: Error during regenerate
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).