Setting up the administrative scheduler on DB2 Version 9.1 for z/OS®

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: After migration to conversion mode, the administrative task scheduler is disabled until you run job DSNTIJSG.

Procedure

  1. 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
      The 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.
      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 in steps DSNTIAS and DSNTIJG of job DSNTIJSG.
    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)
      /*
  2. Enable the administrative task scheduler and administrative enablement routines.

    The administrative task scheduler routines are DB2-supplied routines that enable you to schedule work. The administrative enablement routines are DB2-supplied routines that enable you to execute administrative work immediately.

    Before starting this step, set up the DB2-supplied routines that it enables. For instructions, see the section "Enabling DB2-supplied routines" in DB2 for z/OS Installation Guide at http://publib.boulder.ibm.com/epubs/pdf/dsnigk1f.pdf.

    The following routines are administrative task scheduler routines:

    • ADMIN_TASK_ADD
    • ADMIN_TASK_CANCEL
    • ADMIN_TASK_LIST
    • ADMIN_TASK_OUTPUT
    • ADMIN_TASK_REMOVE
    • ADMIN_TASK_STATUS
    • ADMIN_TASK_UPDATE

    The following routines are administrative enablement routines:

    • ADMIN_COMMAND_DB2
    • ADMIN_COMMAND_DSN
    • ADMIN_COMMAND_UNIX
    • ADMIN_DS_BROWSE
    • ADMIN_DS_DELETE
    • ADMIN_DS_LIST
    • ADMIN_DS_RENAME
    • ADMIN_DS_SEARCH
    • ADMIN_DS_WRITE
    • ADMIN_INFO_HOST
    • ADMIN_INFO_SMS
    • ADMIN_INFO_SQL
    • ADMIN_INFO_SSID
    • ADMIN_INFO_SYSLOG
    • ADMIN_INFO_SYSPARM
    • ADMIN_JOB_CANCEL
    • ADMIN_JOB_FETCH
    • ADMIN_JOB_QUERY
    • ADMIN_JOB_SUBMIT
    • ADMIN_UTL_SCHEDULE
    • ADMIN_UTL_SORT
    1. If you did not create these procedures during installation or migration, customize and run job steps DSNTIAS, DSNTIAE, and DSNTIJG of your customized job DSNTIJSG to define, bind, and grant access to the administrative task scheduler and administrative enablement stored procedures.

      Job step DSNTIJG grants EXECUTE authority on these stored procedures and their packages to PUBLIC, and grants ALL on related result set tables to PUBLIC. If you do not want this authorization granted to PUBLIC, edit the job to grant the authority only to specific users or groups.

      Tip: Do not grant EXECUTE authority to PUBLIC. If you do, anyone that can access DB2 can use these stored procedures.
      Restriction: This job should be executed by a user with all the specific privileges needed.

      These stored procedures run in a WLM-managed stored procedure address space.

    2. In the JCL for starting the WLM-established address space for running the stored procedures whose load module must reside in an APF-authorized library, ensure that all libraries in the STEPLIB DD concatenation are APF-authorized. The name of the WLM environment must match the WLM ENVIRONMENT parameter value in the CREATE PROCEDURE statement for each stored procedure.
    3. If the BPX.DAEMON facility class is active and the BPX.DAEMON.HFSCTL facility class is not defined, perform the following actions for the stored procedures that must be registered to RACF® program control.

      The stored procedures that require RACF® program control are:

      • ADMIN_COMMAND_UNIX
      • ADMIN_JOB_CANCEL
      • ADMIN_JOB_FETCH
      • ADMIN_JOB_QUERY
      • ADMIN_JOB_SUBMIT
      1. Customize and run job step DSNADER in job DSNTIJRA to define the security environment for these stored procedures. You need to uncomment job step DSNADER before you run job DSNTIJRA. You do not need to run any other job steps in job DSNTIJRA.
      2. Ensure that you have a WLM environment for these stored procedures that meets the following requirements:
        • The WLM-established stored procedure address space loads only controlled programs.
        • In the JCL for starting the WLM-established address space for running these stored procedures, ensure that all libraries in the STEPLIB DD concatenation are APF-authorized.
        • The name of this environment must match the WLM ENVIRONMENT parameter value in the CREATE PROCEDURE statement for these stored procedures in the job DSNTIJSG.
    4. Authorize the appropriate users to use one or more of these stored procedures by issuing the GRANT EXECUTE statement.
      Important: The privileges to run DSN8EXP and DSNAEXP should be granted with consideration that DSN8EXP and DSNAEXP can EXPLAIN on any explainable SQL statement that is valid on the system, and that EXPLAIN output can reveal potentially sensitive information. For example, you should not grant access to PUBLIC to use DSN8EXP and DSNAEXP.

Feedback