IBM Support

How to remove hanging jobs in Scheduler

Technote (FAQ)


Question

Scheduled tasks appear as running in the Scheduler even though they have completed.
How to explicitly remove these 'running' tasks.

Cause

When DAS is brought down while a scheduled task is running, the status of the task might
stay in 'running' state even though the job has already finished or was aborted.


Answer

To remove the hanged 'running' tasks from the Scheduler:

1. Locate the 'running' record(s) by getting the corresponding task ID, which can be obtained from the Task Center right most column of main window.

2. Stop the DAS.

3. Identify the tools catalog database and schema by running: db2 get admin cfg
Sample output:

 Tools Catalog Database                    (TOOLSCAT_DB) = TOOLSDB
 Tools Catalog Database Instance         (TOOLSCAT_INST) = DB2
 Tools Catalog Database Schema         (TOOLSCAT_SCHEMA) = SYSTOOLS

Connect to Tools catalog db (TOOLSDB in this sample) and delete the task by running these commands:
db2 connect to TOOLSDB
db2 "delete from SYSTOOLS.MDTASKEXECTY00 where taskID00=XXX"

4. Restart DAS and the Scheduler to check if the 'running' jobs are removed. If not, proceed to step 5.

5. Make sure DAS is stopped again.

6. Issue these commands:
db2 connect to TOOLSDB
db2 "update SYSTOOLS.MDTASKTYPE00 set NUMBEROFEXECUTIONS00=0 where taskID00=XXX"
db2 "update SYSTOOLS.MDTASKTYPE00 set STATE00='0' where taskID00=XXX"
db2 "update SYSTOOLS.MDTASKTYPE00 set CURRENTSTARTDATETIME00=NULL where taskID00=XXX"

7. Restart DAS and the Scheduler. The 'running' tasks should be removed.

Document information

More support for: DB2 for Linux, UNIX and Windows
Database Objects/Config - Instance(DAS)

Software version: 9.1, 9.5, 9.7, 9.8

Operating system(s): Windows

Software edition: All Editions

Reference #: 1116369

Modified date: 18 November 2015