db2scheduled-tasksdb2-luw

Staus NOTRUN in Automatic task scheduler


I created a DB2 task to run my stored procedure automatically at a specific time, I created the task using the ADMIN_TASK_ADD procedure:

CALL SYSPROC.ADMIN_TASK_ADD ( 'WR_AM_ADT_AUTO_CNRRM_SCHDLR', 
                                  NULL,
                                  NULL,
                                  NULL,
                                  '05 16 * * *',
                                  'ASPECT',
                                  'WR_AM_ADT_AUTO_CNRRM',
                                  '81930',NULL,NULL);
                                  
                                  COMMIT;

I want to run my scheduled task every day at 04:05 PM, but it didn't work and giving the status as

NOTRUN, SQLCODE -104

So can anyone please tell me what am I doing wrong?

I also checked my scheduler in task list using following command:

SELECT * from SYSTOOLS.ADMIN_TASK_LIST

I am using DB2 9.7 version on Windows.


Solution

  • The status of the task NOTRUN means an error prevented the scheduler from calling the task's procedure. The SQLCODE indicates the type of error.

    I suggest you the followings;

    Confirm scheduler is enabled.

    db2 > db2set
    DB2_ATS_ENABLE=YES
    

    ATS depends on the SYSTOOLSPACE tablespace to store historical data and configuration information. You can check if the tablespace exists in your system with the following query.

    db2 select TBSPACE from SYSCAT.TABLESPACES where TBSPACE = 'SYSTOOLSPACE'
    

    You can test stored procedure in isolation

    CALL WR_AM_ADT_AUTO_CNRRM()
    

    Then run your task in schedular!