REGENERATE ONEPASS command: Difference between revisions

From m204wiki
Jump to navigation Jump to search
m (→‎Examples: Added the OF clause TO UPDATE n examples. Changed all examples to year 13)
 
(5 intermediate revisions by the same user not shown)
Line 4: Line 4:
<dd>User 0
<dd>User 0
<dt>Function
<dt>Function
<dd>In the event of a media failure, for example, a disk head crash, a REGENERATE ONEPASS command recovers a <var class="product">Model&nbsp;204</var> file by reapplying some or all of the updates that have been made to the file since the time of the last dump.  
<dd>In the event of a media failure, for example, a disk head crash, a REGENERATE ONEPASS command recovers a <var class="product">Model&nbsp;204</var> file by reapplying some or all of the updates that have been made to the file since the previous dump.  
</dl>
</dl>
==Syntax==
==Syntax==
<p class="syntax"><b>REGEN</b>ERATE <b>ONEPASS</b> FILE <i>filename</i> [FROM <span class="term">dumpname</span>]  
<p class="syntax"><b>REGEN</b>ERATE <b>ONEPASS</b> FILE <i>filename</i> [FROM <span class="term">dumpname</span>]  
Line 15: Line 16:
   
   
<b>Where:</b>
<b>Where:</b>
REGENERATE ONEPASS processing executes only Pass One through the CCAGEN data set. 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. See [[REGENERATE command|"REGENERATE: Recovering a file in two passes"]].
REGENERATE ONEPASS processing runs only Pass One through the CCAGEN data set.  
<p>REGENERATE ONEPASS is significantly faster than REGENERATE but cannot be used across recovery runs or discontinuities (such as file create or delete).</p>
<p>If you must regenerate across a recovery process, two passes of the journal are required. You must build <var>[[REGENERATE command | REGENERATE]]</var> commands, not REGENERATE ONEPASS commands, which are invalid.</p>
<ul>  
<ul>  
<li>
<li>
Line 85: Line 88:


==Usage notes==
==Usage notes==
<p class="note"><b>Note:</b> 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 [[REGENERATE command|REGENERATE: Recovering a file in two passes]].)</p>
<p class="note"><b>Note:</b> 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 <var>[[REGENERATE command|REGENERATE]]</var> command.)</p>
<p>An incorrect TO clause generates the following error message.</p>
<p>An incorrect TO clause generates the following error message.</p>
<p class="code">M204.1410: REGENERATE COMMAND REJECTED
<p class="code">M204.1410: REGENERATE COMMAND REJECTED
Line 91: Line 94:
<p>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. </p>
<p>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. </p>
<p>If REGENERATE ONEPASS processing opens a file for which it is <i>not</i> performing a restore, and if that file is marked physically inconsistent, REGENERATE ONEPASS processing for that file is discontinued.</p>
<p>If REGENERATE ONEPASS processing opens a file for which it is <i>not</i> performing a restore, and if that file is marked physically inconsistent, REGENERATE ONEPASS processing for that file is discontinued.</p>
<p>When processing REGENERATE ONEPASS, <var class="product">Model&nbsp;204</var> ends any update unit in progress and begins an update unit that cannot be backed out. For more information about <var class="product">Model&nbsp;204</var> update units, see the <var class="book">Model&nbsp;204 File Manager's Guide</var>.</p>
<p>When processing REGENERATE ONEPASS, <var class="product">Model&nbsp;204</var> ends any update unit in progress and begins an update unit that cannot be backed out. For more information about <var class="product">Model&nbsp;204</var> update units, see [[File_integrity_and_recovery#Update_units_and_transactions|Update units and transactions]].</p>
<p>For a single-user (batch) <var class="product">Model&nbsp;204</var> 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.</p>
<p>For a single-user (batch) <var class="product">Model&nbsp;204</var> 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.</p>
====Using the TO UPDATE option====
You can specify the TO UPDATE option for a single or multiple file run.
<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.)
<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:
<ul>
<li>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:
<code>M204.1409: MISSING STOPPING POINT FOR FILE <i>filename</i></code>.</li>
<li>RC=4 is set.</li>
</ul>
[[Category:Commands]]
[[Category:Commands]]

Latest revision as of 20:14, 12 February 2014

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.