Download CA Workload Automation AE User Guide

Transcript
Define a Database Trigger Job
Examples: Specify Trigger Conditions for Deleted Rows in an Oracle Database
■
This example monitors the emp table for deleted rows. The job runs under a user
who has the authority to create triggers on the database or schema the table
belongs to. The job connects to the default database resource location defined on
the agent. When a row containing deptno 75 is deleted, the job completes.
insert_job: dbtrig_delete
job_type: DBTRIG
machine: dbagent
dbtype: Oracle
trigger_type: DELETE
trigger_cond: old.deptno=75
tablename: emp
owner: scott@orcl
■
This example monitors the emp table for added rows. The job runs under a user
who has the authority to create triggers on the database or schema the table
belongs to. When a row containing an ename beginning with the letter g is added,
the job completes.
insert_job: dbtrig_insert
job_type: DBTRIG
machine: dbagent
dbtype: Oracle
trigger_type: INSERT
trigger_cond: new.ename like 'g%%'
tablename: emp
owner: scott@orcl
connect_string:"jdbc:oracle:thin:@myhost:1521:orcl"
■
This example monitors the emp table for added or updated rows. The job runs
under a user who has the authority to create triggers on the database or schema
the table belongs to. The job completes when a new or updated row does not
contain a job field equal to sales.
Note: The <> symbol indicates not equal to.
insert_job: dbtrig_insertupdate
job_type: DBTRIG
machine: dbagent
dbtype: Oracle
trigger_type: INSERT,UPDATE
trigger_cond: new.job<>'sales'
tablename: emp
owner: scott@orcl
connect_string:"jdbc:oracle:thin:@myhost:1521:orcl"
Chapter 8: Database Jobs 261