17.10.2015 Views

Getting Started with IBM Data Studio for DB2

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Chapter 6 – Managing jobs 195<br />

6.3 Jobs and job components<br />

A job is a container that holds the components that are required to run a script on one or<br />

more databases. When you create a job, you can either schedule it to run on one or more<br />

databases, or you can leave the schedule component of the job empty. A job can also be<br />

run manually from the Job List tab of the job manager. You can also configure multiple jobs<br />

to run sequentially by adding a chain of jobs to the job that you are creating.<br />

The job does not contain any in<strong>for</strong>mation about which databases that the job will run on.<br />

The database in<strong>for</strong>mation is included in one or more schedules that you can create <strong>for</strong><br />

each job.<br />

6.3.1 The components of a job<br />

A job consists of several components, all of which can be defined when you create a job.<br />

The only job components that are required to create a valid job are the job name, the job<br />

ID, and the script. These components are described in Table 6.1.<br />

Job<br />

component<br />

Job ID and<br />

name<br />

(required)<br />

Script<br />

(required)<br />

Schedule<br />

Description<br />

The job ID is the unique identifier of the job and is generated automatically by<br />

job manager. The job name that you specify can be used as a descriptive way<br />

to easily identify the job in the job list or when scheduling jobs.<br />

The script is the executable part of a job and defines the actions that are done<br />

on the database when the job is run. You can enter one script per job.<br />

Important: The job manager does not provide a script editor and does not<br />

verify that the scripts that you enter are valid. Run the script on a database or<br />

use other methods to verify that the script is correct and that it produces the<br />

expected results be<strong>for</strong>e you schedule the job in the job manager.<br />

A schedule defines when a job will be run, whether the job is repeating, and<br />

whether the schedule is limited in number of runs or in time. The schedule<br />

also defines one or more databases on which to run the job.<br />

A job can have any number of schedules attached to it, but each schedule<br />

only applies to one job. A schedule must be active to run the job. Each<br />

schedule has a unique ID that is based on the job ID <strong>with</strong> an integer<br />

appended at the end of the ID.<br />

Example:<br />

The first schedule that is attached to job ID 1234 will have schedule ID 1234-<br />

1. The second schedule that is attached to the same job will have schedule ID<br />

1234-2, and so on.<br />

A schedule is not required; you can also run jobs manually from the job<br />

manager. When you schedule a job on a single database, you can define the

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!