Creating a restart table
If you experience contention, create a restart table for each user that runs apply requests simultaneously on the target database. This practice eliminates contention for the restart table.
High-speed Apply Engine provides sample data definition language (DDL) files to help you create the restart table as follows:
- The HLQ.DBSAMP library contains a member named APTREST. HLQ represents a high-level qualifier that you specified when you installed High-speed Apply Engine.
To create a personal restart table
Create a DDL file with the statements to create a restart table.One method of doing this is to use the sample DDL file located in a member named APTREST in HLQ.DBSAMP library. If you use this file as a template, copy the file, renaming it according to your site requirements. Edit the file with any standard editor.
Regardless of how you create the file, when you have finished, the DDL statements should resemble those shown in figure "Sample DDL to create a restart table: Db2."
- Edit the DDL statements as follows:
- Change the database name and table space name to values that are appropriate for your site.The table space that you specify must be located in the same Db2 subsystem as the target tables for the apply request.
- Change the table name and index name so that they are unique.
(Optional) Define the alias (BMCAPT_APTRSCL) so that it uses the name of the personal restart table. If an earlier version of High-speed Apply Engine is already installed, you must drop and re-create the alias.Do not redefine this alias unless you want all apply requests that do not specify the TableName parameter in the [Restart] section to use the personal restart table. The alias is the default value for this TableName parameter. If an apply request does not specify a restart table name, High-speed Apply Engine writes restart information to the table that the alias represents.
When you have finished editing your DDL file, the statements in it should resemble those in the following figure. The databaseName, tableSpaceName, owner, restartTableName, and indexName variables represent unique values that are appropriate for your environment.
//APTREPOS JOB STATEMENT
//STEP01 EXEC PGM=IKJEFT01,DYNAMNBR=20
//STEPLIB DD DSN=SYS2.DB2V71M.DSNLOAD,DISP=SHR
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(DBAT)
RUN PROGRAM(DSNTEP2)
END
//SYSIN DD *
*--------------------------------------------------------------------
*- DEFINE RESTART DB,TABLESPACE,TABLE,INDEX AND SYNONYM
*--------------------------------------------------------------------
* DROP DATABASE databaseName ;
* COMMIT ;
CREATE DATABASE databaseName
STOGROUP SYSDEFLT
CCSID EBCDIC;
COMMIT;
CREATE TABLESPACE tableSpaceName
IN databaseName
USING STOGROUP SYSDEFLT
PRIQTY 240
SECQTY 48
CLOSE NO
FREEPAGE 0
PCTFREE 0
SEGSIZE 4;
COMMIT;
CREATE TABLE owner.restartTableName
( RESTART_ID CHAR(16) NOT NULL,
REQUEST_ID CHAR(4) NOT NULL,
RECORD_TYPE CHAR NOT NULL,
AGENT_ID SMALLINT NOT NULL,
RECORD_SEQUENCE SMALLINT NOT NULL,
REQUEST_TIMESTAMP TIMESTAMP NOT NULL,
RECORD_TIMESTAMP TIMESTAMP NOT NULL,
TOTAL_LENGTH INTEGER NOT NULL,
DATA LONG VARCHAR NOT NULL
) IN databaseName.tableSpaceName;
COMMIT;
CREATE UNIQUE INDEX owner.indexName
ON owner.restartTableName
( RESTART_ID,
RECORD_TYPE,
AGENT_ID,
RECORD_SEQUENCE
) USING STOGROUP SYSDEFLT;
COMMIT;
CREATE ALIAS BMCAPT_APTRSCL FOR owner.restartTableName;
GRANT ALL ON TABLE owner.restartTableName TO PUBLIC;
COMMIT;
- Save your DDL member, and execute it to create the restart table.
Where to go from here
With the restart table in place, you can specify the restart parameters in the configuration for the apply request. For more information about the parameters, see Specifying-restart-parameters. For more information about restarting an apply request, see Restarting-an-apply-request.