Restarting a WSL

If a work statement list (WSL) fails in the middle of execution, you can restart it at the point that it failed or at a point that you specify. A WSL uses the restart capability of ADBTEP2.

Before you begin

  • Correct any errors in the WSL or any other conditions that caused the failure.
  • Decide which type of restart to use:
    System-controlled
    A system-controlled restart is automated. Db2 Admin Tool restarts the WSL from the point where it failed.
    User-controlled
    A user-controlled restart allows you to restart the WSL from a point different than where it failed.
  • If you want to do a user-controlled restart, you must add a restart point to your WSL. To add a restart statement:
    1. View the WSL.
    2. On the Show Work Statement List (ADB2W1S) panel, specify the I line command next to the statement after which you want to insert a restart point, and press Enter.
    3. On the Insert Work Statement (ADB2W1SI) panel, specify option 9 and specify a name for the restart point next to option 9.
      ADB2W1SI  ------------------ DC1A Insert Work Statement ----------------- 16:59
      Option ===> 9                                                                  
                                                                                     
      Enter the type of statement you want to insert:                                
                                                                                     
       1 - A comment statement                                                       
       2 - A definition SQL statement                                                
       3 - A authorization SQL statement                                             
       4 - A update SQL statement                                                    
       5 - A DB2 command                                                             
       6 - A DSN command                                                             
       7 - A DB2 utility statement                                                   
       8 - A DB2 Admin statement                                                     
       9 - A restart statement          RSTPOINT1                                    
                                                                                     
                                                                                     
                                                                                     

      For more information about the RESTART statement and the allowable values for the restart point name, see RESTART.

    Alternatively you can specify the restart point directly in the batch statement list. Add the line --#RESTART <string> at the point that you want the statement to restart from. In addition, you must add RESTART AT <string> with a terminator as the first line, like the following example:

    //SYSIN DD *
    RESTART AT BOB;
    DROP TABLE
        POSTO.PPP1;
    COMMIT;
    --#RESTART BOB 
    DROP TABLE POSTO.PPP2;
    COMMIT;

    You can add as many user-defined restart points to a WSL as you want, but only one will be used for restart.

About this task

The Batch Restart program (ADBTEP2) enables you to restart or resume the execution of an input stream at an intermediate point if any one of the statements in that stream should fail. The process involves creating or updating a record in a checkpoint table each time that a COMMIT statement is encountered in the input stream. By using this table, execution can be resumed with the first statement following the last successful commit point before the failure, bypassing all prior successfully executed statements.

Procedure

To restart a failed WSL:

  1. On the Work Statement List Library (ADB2W1) panel, reissue the R line command against the WSL.
    Requirement: If the WSL contains parallel processing (the WSL includes PARALLEL statements), the WSL must be restarted in the same mode that it was originally run (either online or batch).
    The Specify Restart Information panel is displayed:
    Figure 1. Specify Restart Information panel
     DB2 Admin ----------- Specify Restart Information: BASEPRCB -- Row 1 to 2 of 2
     Command ===>                                                   Scroll ===> PAGE 
      
     Commands: NEXT                                                                               
     Line commands:  
     B - Checkpoint   V - Edit Restart Info   R - Toggle Restart Report Only                            
     C - Toggle Ckpt Env   I - Toggle Input Env  
    
                            Ckpt --- ENV --- Report   User 
     Sel   Suffix   Restart Fnd   Ckpt  Input  Only   Restart                                                                          
           *        *       *     *     *      *      *  
     ----- -------- ------- ----- ----- ------ ------ --------
                    Y       Y     Y     Y      N      BOB  
    
  2. Depending on the type of restart that you want, take the following actions on the Specify Restart Information panel:
    Option Description
    System-controlled restart (default) To restart the WSL from the point of failure:
    1. In the Restart column, specify Y.
    2. Issue the CONTINUE command.
    User-controlled restart To restart the WSL from a point that you specify:
    1. Issue the V line command.
    2. In the Restart column, enter U.
    3. In the User Restart column, specify the name of the restart point in your WSL or batch statement list. (This value is the value of name in --#RESTART name).
    4. Issue the CONTINUE command.
    Restart report only To simulate a restart without actually running a restart, so that you can see the results before deciding whether to run a restart:
    1. Issue the R line command next to the WSL that you want to restart.
    2. Issue the CONTINUE command.