Using the Oracle GoldenGate Event Marker System to Raise Database Events
Oracle GoldenGate provides an event marker system, also known as the event marker infrastructure (EMI), which enables the Oracle GoldenGate processes to take a defined action based on an event record in the transaction log or in the trail (depending on the data source of the process). The event record is a record that satisfies a specific filter criterion for which you want an action to occur. You can use this system to customize Oracle GoldenGate processing based on database events.
For example, you can use the event marker system to start, suspend, or stop a process, to perform a transformation, or to report statistics. The event marker system can be put to use for purposes such as:
-
To establish a synchronization point at which
SQLEXEC
or user exit functions can be performed -
To execute a shell command that executes a data validation script or sends an email
-
To activate tracing when a specific account number is detected
-
To capture lag history
-
To stop or suspend a process to run reports or batch processes at the end of the day
The event marker feature is supported for the replication of data changes, but not for initial loads.
The system requires the following input components:
-
The event record that triggers the action can be specified with
FILTER
,WHERE
, orSQLEXEC
in aTABLE
orMAP
statement. Alternatively, a specialTABLE
statement in a Replicat parameter file enables you to performEVENTACTIONS
actions without mapping a source table to a target table. -
In the
TABLE
orMAP
statement where you specify the event record, include theEVENTACTIONS
parameter with the appropriate option to specify the action that is to be taken by the process.
You can combine EVENTACTIONS
options, as shown in the following examples.
The following causes the process to issue a checkpoint, log an informational message, and ignore the entire transaction (without processing any of it), plus generate a report.
EVENTACTIONS (CP BEFORE, REPORT, LOG, IGNORE TRANSACTION)
The following writes the event record to the discard file and ignores the entire transaction.
EVENTACTIONS (DISCARD, IGNORE TRANS)
The following logs an informational message and gracefully stop the process.
EVENTACTIONS (LOG INFO, STOP)
The following rolls over the trail file and does not write the event record to the new file.
EVENTACTIONS (ROLLOVER, IGNORE)
For syntax details and additional usage instructions, see Reference for Oracle GoldenGate.