GoldenGate

How to Resolve OGG-00519 with ORA-00942

Recently, I initialized a set of EXTRACT / PUMP / REPLICAT for one schema, but some days after, the REPLICAT abended with this error:

2017-05-10 18:47:15  ERROR   OGG-00519  Fatal error executing DDL replication: error [Error code [942], ORA-00942: table or view does not exist SQL alter table HR.EMPLOYEES modify ...

We saw OGG-00519 as well as ORA-00942. This DDL indicated in the message is apparently irrelevant to the mapped schema (i.e. OE in this case), and REPLICAT tried to apply it to the target database and failed. So I checked the parameter file.

GGSCI (target) 14> view params OE_R

replicat oe_r
assumetargetdefs
userid <username>, password <password>
discardfile ./dirrpt/oe_r.dsc, append, megabytes 50
ddl include all
map OE.*, target OE.*;

Oh, it showed that it will apply all the DDL transported from the source database. Since some DDL may belong to other schemas that could not exist in the target database, so I changed it into our scope by mapped instead of all.

GGSCI (target) 15> edit params OE_R

replicat oe_r
assumetargetdefs
userid <username>, password <password>
discardfile ./dirrpt/oe_r.dsc, append, megabytes 50
ddl include mapped
map OE.*, target OE.*;

Then we start the REPLICAT

GGSCI (target) 16> start OE_R

We passed the trail.

Of course, we can also narrow down DDL scope in the EXTRACT and it will not put it into the trail in the first place.

Leave a Reply

Your email address will not be published. Required fields are marked *