Previous Topic: Database JobsNext Topic: Defining Database Stored Procedure Jobs


Defining Database Monitor Jobs

You can define a Database Monitor (DB_MON) job to monitor a database table for an increase or decrease in the number of rows. To monitor the database table for specific changes, you can add a monitor condition to the job definition. When the condition is met, the job completes. You can set up continuous monitoring so that each time a database change occurs, an alert is triggered. For continuous monitoring, the job state changes to a monitoring state and remains in that state until it is forced complete or cancelled.

Note: To run these jobs, your system requires CA WA Agent for UNIX, Linux, or Windows and CA WA Agent for Databases.

Required Statements

To define a Database Monitor job, you must specify the following statements:

Note: All database jobs require a database user ID and the database resource location. You can use the defaults defined on the agent in the agentparm.txt file or specify the USER and DB_URL statements in the job definition.

Optional Statements

You can specify the following optional statements for a Database Monitor job:

Example: Monitor a Table for a Change in the Number of Rows

Suppose that you want a job to monitor the STAFF table for a change in the number of rows. When a row that has the name Jonson is added or deleted, the job completes. The job uses the database resource location default defined on the agent.

AGENT DB_AGENT
TABLE_NAME STAFF
MON_TYPE ID
MON_COND NAME='Jonson'
USER entadm

Example: Monitor a Table for Increases in the Number of Rows

Suppose that you want a job to monitor the emp table for increases in the number of rows. When a new row has a salary greater than 100000, the scheduling manager sends an alert. The job remains in a monitoring state until it is forced complete or cancelled. The job uses the user name and database resource location defaults defined on the agent.

AGENT DB_AGENT
MON_TYPE I
TABLE_NAME emp CONTINUOUS(high)
MON_COND sal>100000