Creating and scheduling jobs

You can use IBM® Db2® Data Management Console to create and schedule jobs.

Procedure

To create and schedule jobs:

  1. Click Administration and select Jobs.
  2. To create and schedule jobs on specified databases, click Create job and select the type of report from the list.
  3. In the Create new job page, complete the following steps:
    1. Enter the name of the job to be created.
    2. Optional: Provide a short description of the job.
    3. Select the type of script for the job and enter the script that runs on a database.
      • SQL script: The job manager connects to the database and runs the SQL commands that are included in the job script directly on the database.
      • CLP and shell script: The job manager uses SSH to log in to the database server as the user ID that is defined in the database connection, and then runs the command line processor commands directly on the Db2 console of the server. CLP and shell scripts are not supported on container-based Db2 products.
        Note: To run the Db2 CLP script jobs on a database, the user ID that is used to run the job must have permission to log in to the database server by using SSH. Ensure to specify the complete path if you want to read or execute files by using CLP script because the console might not receive the environment variable from the Db2 server.
    4. Optional: Click the Settings icon in the statement text box. The Script setting window displays.
      1. Enter the Db2 statement delimiter (; is the default value ).
      2. Click the Automatically commit each statement toggle button to set the option to Yes or No.
      3. Click Save.
    5. To create a scheduled job, select Run this job on a schedule. Specify the Start date, and Time, for scheduling the job.
    6. Optional: Define an exclusion period to a job schedule. Specify the start and end time of the day for the period.
    7. Specify the job timeout duration. When enabled, the job stops when it runs longer than the set duration.
    8. Select the events for which you want to receive notifications. The options are:
      • Error - Job execution returns an error
      • Stopped - Job execution is terminated or stopped due to timeout
      • Success - Job execution succeeds
      • Warning - Job execution succeeds with warning
      To know more about job execution status, see Job status.
    9. Provide one or more email addresses.
    10. Click Next.
    11. Select the credential type. The options are:
      • Shared credential
      • Personal credential
    12. Select one or more databases to run the job.
    13. Click Next.
    14. Review the job details and click Finish.
      The job is created and listed in the Jobs page where you can view the job definition, schedule detail, and last run status.
  4. Click the checkbox in front of the job name that is listed in the Jobs page and do one of the following:
    • To pause one or more scheduled instances of the job, select the jobs and click Pause schedule.
    • To resume action or one or more scheduled instances of job, select the jobs and click Resume schedule
    • To delete one or more jobs, select the jobs and click Delete.
  5. To update job, click the action icon in the Jobs page and do one of the following:
    • To modify job settings, click Edit.
    • To copy job type, click Copy.
    • To run the job with credentials, select the option to run the job with existing credential or run with alternative credentials by providing the username and password.
    • To add collaborators to the , click Access control.
    • To create a job chain, click Create job chain.
  6. To cancel the action, click Cancel.