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:
- View the WSL.
- 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.
- 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: