I am planning to configure a simple GoldenGate configuration and want to implement an exception table that will store all the exceptions. I followed two links, neither of which work for me:
- Troubleshoot Oracle GoldenGate Using Exception Handler
- Creating a GoldenGate Exception Handler to Trap and Log Oracle Errors
My Extract Parameter File
extract ext9
userid ogg_user, password oracle
rmthost targetGG, mgrport 7809
rmttrail /u01/app/oracle/product/gg_trg/dirdat/np
table scott.emp;
Replicat File
replicat rep9
ASSUMETARGETDEFS
userid ogg_user, password oracle
include ./dirprm/EXCEPTION_HANDLER.mac
REPERROR (DEFAULT, EXCEPTION)
REPERROR (DEFAULT2, ABEND)
REPERROR (-1, EXCEPTION)
MAP scott.emp, TARGET scott.emp;
MAP scott.emp #exception_handler();
Exception Handler Macro
Created in ./dirprm/EXCEPTION_HANDLER.mac
:
MACRO #EXCEPTION_HANDLER
BEGIN
, TARGET GGATE_ADMIN.ALLEXCEPTIONS
, COLMAP ( REPLICAT_NAME = @GETENV("GGENVIRONMENT", "GROUPNAME"))
, 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 = @GETENV ("GGHEADER", "LOGPOSITION")
, COMMITTIMESTAMP = @GETENV ("GGHEADER", "COMMITTIMESTAMP"))
, INSERTALLRECORDS
, EXCEPTIONSONLY;
END;
This is the error I have been getting. I have tried/Googled a lot to get rid of this, finally posting it here for help:
2016-06-09 17:18:12 ERROR OGG-00212 Invalid option for MAP: TABLE_NAME.
I don't know what is causing the problem. I have tried all space issues found on Google and with other bloggers but no success.
Best Answer
There is an error in the code:
There is double bracket at the end of the line.