Posted by: michaelverzijl | 15/10/2011

Handle truncates in GoldenGate

If you are using GoldenGate for a zero downtime migration and the source system uses TRUNCATES of tables, don’t forget to mention this in the Extract and Replicat parameter file:

Extract

EXTRACT ext1
USERID ggs_owner, PASSWORD ggs_owner
RMTHOST 127.0.0.1, MGRPORT 7809
rmttrail ./dirdat/r1
gettruncates
TABLE schema_src.*;

Replicat

REPLICAT rep1
ASSUMETARGETDEFS
USERID ogg_owner, PASSWORD ogg_owner
gettruncates
map schema_src.* , target schema_tar.* ;

Documentation

TRUNCATES
Bi-directional replication of TRUNCATES is not supported, but you can configure these operations to be replicated in one direction, while data is replicated in both directions. To replicate TRUNCATES (if supported by Oracle GoldenGate for the database) in an active-active configuration, the TRUNCATES must originate only from one database, and only from the same database each time.
Configure the environment as follows:

  • Configure all database roles so that they cannot execute TRUNCATE from any database other than the one that is designated for this purpose.
  • On the system where TRUNCATE will be permitted, configure the Extract and Replicat parameter files to contain the GETTRUNCATES parameter.
  • On the other system, configure the Extract and Replicat parameter files to contain the IGNORETRUNCATES parameter. No TRUNCATES should be performed on this system by applications that are part of the Oracle GoldenGate configuration.
  • Advertisements

    Responses

    1. The explanation in the documentation doesn’t make sense.
      If on the secondary system you “configure the Extract and Replicat parameter files to contain the IGNORETRUNCATES parameter”, the Replicate in the Secondary system will ignore the truncate issued by the Primary system.

    2. I have configured GG for few schemas and it is working fine. Now my requirement is, we have to delete huge records from a table in source db, this particular delete should not replicate in target db. We need to maintain the records in Target database.

      Is there configuration to achieve this?


    Leave a Reply

    Fill in your details below or click an icon to log in:

    WordPress.com Logo

    You are commenting using your WordPress.com account. Log Out /  Change )

    Google+ photo

    You are commenting using your Google+ account. Log Out /  Change )

    Twitter picture

    You are commenting using your Twitter account. Log Out /  Change )

    Facebook photo

    You are commenting using your Facebook account. Log Out /  Change )

    Connecting to %s

    Categories

    %d bloggers like this: