Adding a task to the administrative task scheduler

You can use the ADMIN_TASK_ADD procedure to define new scheduled tasks. The parameters that you use when you call the procedure define the schedule and the work for each task.

Before you begin

  • Before you can add a task successfully, you must set up the administrative task scheduler. In particular, if the SYSTOOLSPACE table space does not exist, the ADMIN_TASK_ADD procedure returns an SQL0204N error message.
  • You must have EXECUTE privilege on the ADMIN_TASK_ADD procedure.


  • The administrative task scheduler only executes procedure (also known as stored procedure) tasks. All restrictions that apply to procedures are still in effect.
  • The scheduler does not support the execution of procedures that perform a database connection without a specified user ID and password.
  • The scheduler can only execute tasks on active databases. The database must be active on all database partitions.


  1. Connect to the database.
  2. If the task calls a user-defined procedure, issue the appropriate CREATE PROCEDURE statement.
  3. Determine the schedule for when and how often you want the task to be executed.
  4. Call the ADMIN_TASK_ADD procedure to schedule the task.
  5. Commit the changes.


Every five minutes the administrative task scheduler connects to active databases to check for new or updated tasks. It then adds or updates the tasks in the scheduler task lists. At the same time, the scheduler analyzes the task to schedule its next execution.

To retrieve information about the newly created task, use the ADMIN_TASK_LIST administrative view.