This chapter includes the following sections:
Oracle GoldenGate release 12.2 introduced metadata in trail, which can be used by either the Extract or the Replicat process as the metadata definitions. Metadata in trail makes the separate source definitions file unnecessary as in previous releases. For the examples that follow, a simple
TCUSTORD trail is used (matching the demo SQL provided with the Oracle GoldenGate software download), along with a source definitions file defining the data types used in the trail.
Replicat user exit must have access to the source definitions in order to run. Source metadata must be provided either from a static source definitions file or by using the metadata in trail feature where the metadata can be obtained from the trail. However, the Extract process does require metadata describing the trail data. Either the Extract must login to a database for metadata, or a source definitions file can be provided. In either case, the Extract cannot be in
PASSTHRU mode when using a user exit.
To run the user exit, simply start the Replicat process from GGSCI:
GGSCI> START REPLICAT javaue GGSCI> INFO REPLICAT javaue
INFO command returnS information similar to the following:
REPLICAT JAVAUE Last Started 2011-08-25 18:41 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:00 ago) Log Read Checkpoint File ./dirdat/bb000000 2011-09-24 12:52:58.000000 RBA 2702
If the Replicat process is running and the file handler is being used (as in the example above), then you should see the output file
output.xml in the Oracle GoldenGate installation directory (the same directory as the Replicat executable).
If the process does not start or abends, see Checking for Errors.
There are two checkpoints for an Replicat running the user exit: the user exit checkpoint and the Replicat checkpoint. Before rerunning the Replicat, you must reset both checkpoints:
In this example, the name of the Replicat group is
javaue, so this will default to the checkpoint prefix.
cmd>d el JAVAUE.cpj
$ rm JAVAUE.cpj
Do not modify checkpoints or delete the user exit checkpoint file on a production system.
GGSCI> ALTER REPLICAT JAVAUE, EXTSEQNO 0, EXTRBA 0
GGSCI> START JAVAUE GGSCI> INFO JAVAUE REPLICAT JAVAUE Last Started 2011-08-25 18:41 Status RUNNING Checkpoint Lag 00:00:00 (updated 00:00:00 ago) Log Read Checkpoint File ./dirdat/ps000000 2011-09-24 12:52:58.000000 RBA 2702
It may take a few seconds for the Replicat process status to report itself as running. Check the report file to see if it abended or is still in the process of starting:
GGSCI> VIEW REPORT JAVAUE