Creating a restart table


The installation procedures for the High-speed Apply Engine create a restart table that is used if you do not include the TableName parameter in the [Restart] section of the configuration.

Use the procedures in this section to create additional restart tables that High-speed Apply Engine can use to track apply processing.

Before you begin

By default, High-speed Apply Engine uses a single restart table for all apply requests. (This table can be the restart table created during installation, or one that you designate.) In normal use, this practice works well. However, if you run a large number of apply requests simultaneously on the same target database, you might begin to experience resource contention for the single 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

  1. 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."

  2. Edit the DDL statements as follows:
    1. 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.
    2. Change the table name and index name so that they are unique.
    3. (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;
  3. 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.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*