Home » Server Options » Replication » Error handling in GG (GG Version 11g)
Error handling in GG [message #581656] Tue, 09 April 2013 12:21 Go to next message
tigsav
Messages: 44
Registered: April 2012
Member
Hi All,

I am currently facing an issue in handling the errors in Goldengate.
I am using REPERRORS to associate the errors and Also defined an exception handler to handle it.
But my replicat process is abending .

Can you please help here?
I will post the replicat file shortly.

Thanks
tigsav
Re: Error handling in GG [message #581689 is a reply to message #581656] Tue, 09 April 2013 23:58 Go to previous message
tigsav
Messages: 44
Registered: April 2012
Member
Hi All ,

PFB the replicat file

<code>
REPLICAT REP1
SETENV (ORACLE_SID= "POCSTAGE")
SETENV (ORACLE_BASE="/dboracle/app/oracle")
SETENV (NLS_LANG = "AMERICAN_AMERICA.AL32UTF8")
userid gg_owner, password gg_owner
--HANDLECOLLISIONS
--source and target definitions
--APPLYNOOPUPDATES
--GETUPDATES
SOURCEDEFS /archive/gg/dirsql/alltables.sql
--BATCHSQL
IGNOREDELETES
--REPERROR (1403, DISCARD)
--discardfile /archive/gg/discard/rep1_discard.txt, append, megabytes 10
-- This starts the macro
MACRO #exception_handler
BEGIN
TARGET gg_owner.exceptions COLMAP (rep_name = "REP1",table_name = @GETENV("GGHEADER", "TABLENAME"),errno = @GETENV("LASTERR",
"DBERRNUM"),dberrmsg = @GETENV("LASTERR", "DBERRMSG"),optype = @GETENV("LASTERR", "OPTYPE"),errtype = @GETENV("LASTERR", "ERRT
YPE"),logrba = @GETENV("GGHEADER", "LOGRBA"),logposition = @GETENV("GGHEADER", "LOGPOSITION"),committimestamp = @GETENV("GGHEA
DER", "COMMITTIMESTAMP")) INSERTALLRECORDS EXCEPTIONSONLY;
END;
-- This ends the macro
--MACRO #exception_handler_test
--BEGIN
--TARGET gg_owner.exceptions COLMAP (rep_name = ROW_ID,table_name = @GETENV("GGHEADER", "TABLENAME"),errno = @GETENV("LASTERR"
, "DBERRNUM"),dberrmsg = @GETENV("LASTERR", "DBERRMSG"),optype = @GETENV("LASTERR", "OPTYPE"),errtype = @GETENV("LASTERR", "ER
RTYPE"),logrba = @GETENV("GGHEADER", "LOGRBA"),logposition = @GETENV("GGHEADER", "LOGPOSITION"),committimestamp = @GETENV("GGH
EADER", "COMMITTIMESTAMP")) INSERTALLRECORDS EXCEPTIONSONLY;
--END;
--REPERROR (1403, EXCEPTION)
--REPERROR (-1, EXCEPTION)
REPERROR (DEFAULT,EXCEPTION)
--REPERROR (1163, EXCEPTION)
--Specify table mapping -
INSERTMISSINGUPDATES
MAP ASSET, TARGET ASSET, COLMAP (ROW_ID = ROW_ID,CREATED = CREATED,LAST_UPD = LAST_UPD,BU_ID = BU_ID,BILL_A
CCNT_ID = BILL_ACCNT_ID,OWNER_ACCNT_ID = OWNER_ACCNT_ID,PAR_ASSET_ID = PAR_ASSET_ID,PROD_ID = PROD_ID,SERIAL_NUM = SERIAL_NUM,
SERVICE_POINT_ID = SERVICE_POINT_ID,SERV_ACCT_ID = SERV_ACCT_ID,STATUS_CD = STATUS_CD,PROCESS_TIMESTAMP = @DATENOW(),INTEGRATI
ON_ID = INTEGRATION_ID, PROCESS_FLAG = @IF (0<1,0,1)), KEYCOLS (ROW_ID);
MAP ASSET #exception_handler();
</code>

And the report of replicat file shows the error saying unique key violated.and its geting abended but not handling those exceptions.

Any help would be highly appreciated

Thanks !!!
tigsav


Previous Topic: Can I do replication between 10g and 11g on Oracle
Next Topic: Replication products
Goto Forum:
  


Current Time: Tue Nov 25 23:28:06 CST 2014

Total time taken to generate the page: 0.09495 seconds