Book Image

Oracle Goldengate 12c Implementers Guide

Book Image

Oracle Goldengate 12c Implementers Guide

Overview of this book

Table of Contents (21 chapters)
Oracle GoldenGate 12c Implementer's Guide
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
GGSCI Commands
GoldenGate Installed Components
Acronyms
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...