Installation step 24: Set up the administrative task scheduler

You can use the administrative task scheduler to execute administrative tasks according to a time-based or event-based schedule.

Before you begin

You should have run job DSNTIJRA and job DSNTIJIN before you set up the administrative task scheduler.

About this task

Restriction: Start of changeAfter migration to Db2 12, the administrative task scheduler is disabled until you run job DSNTIJRT.End of change

The following figure shows an overview of the steps for installing and configuring the administrative task scheduler.

Figure 1. Setting up the administrative task scheduler
Begin figure summary.This figure shows the various components that need to be configured for the administrative task scheduler. Detailed description available.

Procedure

To set up the administrative task scheduler:

  1. Customize the administrative task scheduler address space startup procedure (xxxxADMT) in job DSNTIJMV.
    The name of the startup procedure needs to match the value of the ADMTPROC subsystem parameter. Before using the startup procedure, locate and review the settings for the following parameters:
    DB2SSID
    The name of this Db2 subsystem.
    DFLTUID
    Start of changeThe default ID that is used by the administrative task scheduler to execute its tasks. DFLTUID must be different than the ID that is used to start this address space. DFLTUID must be an ID that can be used as a logon ID and has a password. DFLTUID cannot be a group ID.End of change
    TRACE
    Indicates whether to activate tracing for the administrative task scheduler. The value can be ON or the default value of OFF.

    You can specify other parameters, such as ERRFREQ, MAXHIST, MAXTHD, or STOPONDB2STOP in the startup procedure similarly to the three parameters DB2SSID, DFLTUID and TRACE.

    ERRFREQ
    Specifies how frequently message DSNA679I displays on the console, indicating that one of the redundant, active copies of the task list is not accessible. By default, this message displays on the console once per minute, for example, when Db2 is offline.
    MAXHIST
    Specifies the number of status entries per task that are stored. This parameter is a positive integer with a default value of 10. When the limit is reached, the oldest status entries are deleted.
    MAXTHD
    Specifies the maximum number of execution threads for an administrative task scheduler. The default value is 99.
    STOPONDB2STOP
    Specifies that the administrative task scheduler will terminate when Db2 is stopped.

    Also locate and review the ADMTDD1 DD statement. The VSAM data set that is indicated must match the VSAM task list data set that is defined in job DSNTIJIN.

    The following example shows how these parameters can be updated.

    //DSNADMT  PROC LIB='DSN!!0.SDSNLOAD',
    //          DB2SSID=DSN,
    //          DFLTUID=DFLTUID,
    //          TRACE=OFF,
    //          MAXTHD=10 
    //*
    //STARTADM EXEC PGM=DSNADMT0,DYNAMNBR=100,REGION=0K,  
    //          PARM=('DB2SSID=&DB2SSID',
    //          ' DFLTUID=&DFLTUID',  
    //          ' TRACE=&TRACE' 
    //          ' MAXTHD=&MAXTHD' 
    //          ' ERRFREQ=1440' 
    //          ' STOPONDB2STOP')
    //STEPLIB  DD DISP=SHR,DSN=&LIB 
    //ADMTDD1  DD DISP=SHR,DSN=DSNC!!0.TASKLIST           
  2. Ensure that the administrative task scheduler routines were enabled.
    They were enabled by job DSNTIJRT.
  3. Create a job to make image copies of the administrative task scheduler table spaces. Establish a schedule for making image copies.
    In general, you should back up important databases on a regular basis. The database for the administrative task scheduler is no exception and should be copied on the same frequency as the Db2 catalog and directory. The following example shows how to copy the table spaces in this database to stacked data sets on tape with a retention period of 99 days:
    //*
    //DSNTIC  EXEC PGM=DSNUTILB,PARM='DSN,IMAGCOPY',COND=(4,LT)
    //SYSPRINT DD  SYSOUT=*
    //SYSUDUMP DD  SYSOUT=*
    //DSNTRACE DD  SYSOUT=*
    //SYSLISTD DD  *
      LISTDEF DSNLDEF
              INCLUDE TABLESPACES DATABASE DSNADMDB
    //SYSIN    DD  *
    
      TEMPLATE DSNTPLT
               DSN(prefix.IMAGCOPY.&DB..;&TS.;)
               DISP (NEW,KEEP,DELETE)
               UNIT TAPE
               STACK YES
               RETPD 99
          COPY LIST DSNLDEF
               COPYDDN(DSNTPLT)
    /*