October 30, 2012

The Administrative Task Scheduler

Chapter 9.9 of the "DB2 10 for z/OS Technical Overview" has a lot of good information on DB2-supplied stored procedures. The first section of this overview (9.9.1) examines installation and lists several IBM manuals and Redbooks with more information. It also covers something I wanted to learn more about, the administrative task scheduler.

The administrative task scheduler provides an interface to add, remove and list tasks that are executed at planned intervals. At each point in time when the scheduler detects that a task should be executed, it drives the task execution according to the work described in the task definition. There is no user interaction. The scheduler delegates the execution of the task to one of its execution threads, which executes the stored procedure or the JCL job described in the task's work definition. The execution thread waits for the end of the execution and then notifies the scheduler. Finally, the scheduler stores the task's execution status in its redundant task lists, in relation with the task itself.

The scheduler starts as a task on the z/OS system during DB2 startup or initialization. It remains active unless it is explicitly stopped, even when DB2 terminates.

Of course, mainframe enterprises have their own production level scheduling packages. So why is the administrative task scheduler important? Because it simplifies what can be the rigorous process of setting up a production schedule and putting all the support procedures in place. While this effort is necessary in production environments, DBAs generally don't go to this trouble to schedule jobs on test and development systems. So in these environments, having an informal way to schedule backups, reorgs or other tasks would be really handy.

I believe the administrative task scheduler has been part of DB2 for z/OS since Version 8. It goes back quite a bit further on DB2 for LUW, where it's widely used. Again, the fact that mainframe environments already rely on formal scheduling packages is the likely reason many DB2 for z/OS DBAs don't use the scheduler.

Do you use the administrative task scheduler with your test and development systems? If so, which tasks do you schedule?