Book Image

Oracle Goldengate 12c Implementers Guide

By : John P Jeffries
Book Image

Oracle Goldengate 12c Implementers Guide

By: John P Jeffries

Overview of this book

The book is aimed at Oracle database administrators, project managers, and solution architects who wish to extend their knowledge of GoldenGate. The reader is assumed to be familiar with Oracle databases. No knowledge of GoldenGate is required.
Table of Contents (16 chapters)
12
A. GGSCI Commands
13
B. GoldenGate Installed Components
14
C. Acronyms
15
Index

Using and defining macros


As in many programmable software products, defining a macro allows you to automate repetitive tasks. This can be very useful when you configure a GoldenGate process. For example, trapping an exception for each MAP statement in a Replicat parameter file is both necessary and repetitive. However, defining the macro at the start of the parameter file allows the code to be called by an alias, multiple times in the configuration.

The following code defines the #exception_handler() macro in a Replicat parameter file. All macros have a hash # character prefix in their name as follows:

-- This starts the macro
MACRO #exception_handler
BEGIN
, TARGET ggs_admin.exceptions
, COLMAP ( rep_name = "ROLAP01"
, table_name = @GETENV ("GGHEADER", "TABLENAME")
, errno = @GETENV ("LASTERR", "DBERRNUM")
, dberrmsg = @GETENV ("LASTERR", "DBERRMSG")
, optype = @GETENV ("LASTERR", "OPTYPE")
, errtype = @GETENV ("LASTERR", "ERRTYPE")
, logrba = @GETENV ("GGHEADER", "LOGRBA")
, logposition...