IBM Books

DB2 Query Patroller User's Guide


Scheduling a Recurring Query

This chapter provides information and procedures for using the DB2 Query Patroller Recurring Query Scheduler window. The following topics are covered:


The Recurring Query Scheduler Window

You can use the Recurring Query Scheduler window to schedule a recurring query for a specific date and time. The recurring query scheduler can also be used to schedule queries for a date range.


Accessing the Recurring Query Scheduler Window

To access the DB2 Query Patroller Recurring Query Scheduler window, schedule a query as explained in the section Scheduling a Recurring Query.

The DB2 Query Patroller Recurring Query Scheduler window has four main sections:

The Recurring Query Scheduler window is illustrated below:
Recurring Query Scheduler Window


Opening an Existing Schedule for a Recurring Query

When you open the DB2 Query Patroller Recurring Query Scheduler window, a new, empty window displays. You can also open a previously saved schedule for a recurring query and perform the same functions as can be performed for a new query schedule. To open an existing schedule, select Open from the File drop-down list and select a path and file name.


Setting a Date Range and Time

The upper left portion of the DB2 Query Patroller Recurring Query Scheduler window contains a panel of push buttons for setting the date range and time. This panel contains three sets of push buttons: one for setting the first date the query should run, one for setting the last date the query should run, and one for setting the time of day the query should start. The date range is in the format of month, day, and year. The time push buttons are in the format of hour, minute, and an a.m. or p.m. designator. These push buttons are illustrated below:
Date Range and Time push buttons

To set a date and time for a recurring query, perform the following steps:

  1. In the Range: From section, click the left and right mouse push buttons to set the first month, day, and year on which the query should begin running. Clicking the left mouse push button increments the number displayed on a push button. Clicking past the last day in a month increments the month value to the next month. Clicking the right mouse push button decrements the number displayed on a push button. Clicking past the first day in a month decrements the month value to the previous month.
    Note:The default date is the current date. Queries scheduled before the current date are immediately submitted for processing.

  2. In the Range: To section, click the left and right mouse push buttons to set the last month, day, and year on which the query should run.
    Note:This date must be equal to or greater than the Range: From date. The default value is 12/31/2010.

  3. From the Create Time section, click the left and right mouse push buttons to set the hours and minutes at which the query should start running. The a.m. or p.m. designator is set automatically.

Using the Perpetual Calendar

The perpetual calendar displays in the lower-right portion of the DB2 Query Patroller Recurring Query Scheduler window. The calendar contains the following features:

An example of the calendar is illustrated below:
Month in the Calendar

Scrolling through the Calendar Months

You can click the arrow push buttons above the calendar to scroll through the calendar months. You can only scroll through the calendar months which fall between the selected Range: From and Range: To date values.

Understanding the Symbols for a Calendar Cell

Calendar cells represent the days in the month. The table below describes the various ways these cells can appear.

Table 3. Calendar Cell Icons
Icon Description

Figure Qe10 not displayed.

Normal. Day falls within date range and is not the current day.

Figure Qe11 not displayed.

Grayed. Day does not fall within date range and is not current day.

Figure Qe12 not displayed.

Current day.

Figure Qe14 not displayed.

Selected day. Cell is depressed and is darker than other cells.

Figure Qe15 not displayed.

Schedule gauge bar. A schedule guage bar indicates a scheduled query for this day.


Scheduling a Query for a Specific Day in the Perpetual Calendar

To schedule a query to run on a specific day in the perpetual calendar, perform the following steps:

  1. Access the Recurring Query Scheduler window as explained in Accessing the Recurring Query Scheduler Window.

  2. Set the date range push buttons to display the month you want to schedule a query for. See Setting a Date Range and Time.

  3. Click the day of the month you want the query to run.

  4. Click Add>>>.

The specified time displays in the field next to the Add>>> push button and the selected calendar day displays a schedule gauge similar to the one shown in the calendar cell icons table above.


Scheduling a Query to Recur Every Day in a Given Date Range

To schedule a query to run for all days in a given date range, perform the following steps:

  1. Access the Recurring Query Scheduler window as explained in Accessing the Recurring Query Scheduler Window.

  2. Set the date range for the recurring query. See Setting a Date Range and Time for instructions on setting a date range.
    Note:You can only schedule a query to recur for a maximum of 31 days.

  3. Click the Daily tab.

    The Daily page displays as illustrated below:
    Daily Tab

  4. On the Daily page, click Day.

  5. Click Add>>.

    All calendar days within the specified date range are displayed with schedule gauges and the time of query execution is displayed in the field next to the Add>> push button.


Scheduling a Query to Recur Weekly

Use the Weekly page to schedule a query to run on a specific day and week in a month.

The Weekly page contains a weekly queries section that represents each day in the week. This page also contains radio buttons for selecting the time of month the query should be scheduled.

The weekly queries section and radio buttons work together to define when a recurring query will run. For example, if you clicked Mon in the weekly queries section and selected the First in Month radio button, the query is scheduled to run on the first Monday of each month in the date range you have specified. Selecting the Third in Month radio button schedules the query to run on the third Monday of each month in the date range you have specified. You can select any combination of radio buttons. Selecting the All in Month radio button causes all of the other radio buttons to be selected.

To schedule a query to recur weekly, perform the following steps:

  1. Access the Recurring Query Scheduler window as explained in Accessing the Recurring Query Scheduler Window.

  2. Set the date range for the recurring query. See Setting a Date Range and Time for instructions on setting a date range.

  3. Click the Weekly tab.

  4. On the Weekly page, select the day of the week you want the query to run.

  5. Select the appropriate radio buttons to set the time of month the query will run.

  6. Click Add>>>.

    The days that the query is scheduled to run are indicated in the perpetual calendar section by schedule gauges.


Scheduling a Query to Recur Monthly

Use the Monthly page to schedule a query for a specific day for all months in a given date range. To schedule a query to recur monthly, perform the following steps:

  1. Access the Recurring Query Scheduler window as explained in Accessing the Recurring Query Scheduler Window.

  2. Set the date range for the recurring query. See Setting a Date Range and Time for instructions on setting a date range.

  3. Click the Monthly tab.

  4. On the Monthly page, select a day for the query to execute.

  5. Click Add>>.

    The perpetual calendar displays a schedule gauge on the scheduled day for each month in the specified date range.


Scheduling a Query to Recur on the Last Day of the Month

To schedule a query on the last day of the month, perform the following steps:

  1. Access the Recurring Query Scheduler window as explained in Accessing the Recurring Query Scheduler Window.

  2. Set the date range for the recurring query. See Setting a Date Range and Time for instructions on setting a date range.

  3. Click the Last of Month tab.

  4. On the Last of Month page, click Last.

    The last day of the month displays a schedule gauge and the scheduled query time displays to the right of the Add>> push button.


Saving a Recurring Query Schedule

After scheduling a recurring query in the DB2 Query Patroller Recurring Query Scheduler window, you can save the schedule. You can use the same schedule for different queries. To save a query schedule, select Save from the File drop-down list.
Note:Performing the Save function saves the schedule of dates; it does not schedule the queries in the DB2 Query Patroller system.


Sending a Recurring Schedule

After setting a recurring query schedule, you can send the schedule to the DB2 Query Patroller system for processing. To send a query schedule to the DB2 Query Patroller system, perform the following steps:

  1. Access the Recurring Query Scheduler window as explained in Accessing the Recurring Query Scheduler Window.

  2. If necessary, open the calendar schedule as explained in Opening an Existing Schedule for a Recurring Query.

  3. Click Send. The Send push button is illustrated below:
    Send push button

Removing a Recurring Scheduled Query

In addition to scheduling a new query, the Query Scheduler allows you to remove an existing recurring query.

Removing a Query for a Specific Day in the Perpetual Calendar

To remove a scheduled query for a specific day in the calendar, perform the following steps:

  1. Access the Recurring Query Scheduler window as explained in Accessing the Recurring Query Scheduler Window.

  2. If necessary, open the saved query schedule as explained in Opening an Existing Schedule for a Recurring Query.

  3. Click the day of the month for which you want to delete a query. The day must display a schedule gauge in order for you to remove a scheduled query.

  4. If more than one query is scheduled to run, click the scheduled time that you want to remove in the Selected Times panel.

  5. Click <<Remove.

    The recurring query is removed from the selected day. The scheduled time for the query is no longer displayed in the Selected Times panel.

Removing a Recurring Query Scheduled to Run for All Days in a Date Range

To remove a query scheduled to run at a specific time for all days in a given date range, perform the following steps:

  1. Access the Recurring Query Scheduler window as explained in Accessing the Recurring Query Scheduler Window.

  2. Click the Daily tab.

    On the Daily page, a schedule gauge displays on the Day push button. On the calendar, all days in the scheduled date range display schedule gauges.

  3. Click Day.

  4. If more than one query is scheduled to run on this day, select the scheduled time that you want to remove in the Selected Times panel.

  5. Click <<Remove.

    The recurring query is removed from the schedule and the schedule gauges no longer appear.

Removing a Weekly Recurring Query

To remove a recurring weekly query, perform the following steps:

  1. Access the Recurring Query Scheduler window as explained in Accessing the Recurring Query Scheduler Window.

  2. Click the Weekly tab.

    On the Weekly page, a schedule gauge displays on the Weekly Queries push button and on the corresponding day in the perpetual calendar.

  3. Click the Weekly Queries push button containing the schedule gauge.

  4. If more than one query is scheduled to run on that day, click the scheduled time that you want to remove in the Selected Times panel.

  5. Click <<Remove.

    The scheduled weekly query is removed from the calendar and the schedule gauges no longer appear.

Removing a Recurring Monthly Query

To remove a monthly recurring query, perform the following steps:

  1. Access the Recurring Query Scheduler window as explained in Accessing the Recurring Query Scheduler Window.

  2. Click the Monthly tab.

    On the Monthly page, a schedule gauge displays on day of the recurring query. A schedule gauge appears on the corresponding day in the perpetual calendar.

  3. On the Monthly page, click the day containing the schedule gauge.

  4. If more than one query is scheduled to run on that day, click the scheduled time that you want to remove in the Selected Times panel.

  5. Click <<Remove.

    The scheduled monthly query is removed from the calendar and the schedule gauge no longer appears.

Removing a Recurring Query Scheduled to Run on the Last Day of the Month

To remove a scheduled query from the last day of the month, perform the following steps:

  1. Access the Recurring Query Scheduler window as explained in Accessing the Recurring Query Scheduler Window.

  2. Click the Last of Month tab.

    On the Last of Month page, a schedule gauge displays on the Last push button and on the last day of the month in the perpetual calendar.

  3. On the Last of Month page, click the Last push button.

  4. If more than one query is scheduled to run on this day, click the scheduled time that you want to remove in the Selected Times panel.

  5. Click <<Remove.

    The scheduled query is removed from the calendar and the schedule gauges no longer appear.

Viewing a Report of Scheduled Queries

To view a report of all scheduled queries in a date range, select Print Preview from the File drop-down list.

While viewing the report, click one of the following push buttons:


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]