Forum Stats

  • 3,769,008 Users
  • 2,252,898 Discussions
  • 7,874,840 Comments

Discussions

replicate the changes and capture the DML flages did it with time

Omohei
Omohei Member Posts: 169 Blue Ribbon

We have a regulatory requirement to maintain a replica all changes to the production table that incl

we have OGG 19 , Oracle DB 12.1.2 on both source and target

the below extract and replic works fine with insert/update but issue in delete as it deleted the recode itself not mark it as with Flag "D" only as requirments

Target Table

CREATE TABLE "GG_ADMIN"."TEST2" 

  ( "X" NUMBER, 

"Y" VARCHAR2(20 BYTE), 

"OPERATION_TYPE" CHAR(20 BYTE), 

"TIMESTAMP" TIMESTAMP (6), 

CONSTRAINT "PK1" PRIMARY KEY ("X")

)

Replica OGG

REPLICAT REPEBS

SETENV (ORACLE_HOME = '/u01/app/oracle/product/12.2/db_1')

SETENV (TNS_ADMIN = '/u01/app/oracle/product/12.2/db_1/network/admin')

SETENV (ORACLE_SID="NICDEV")

USERID [email protected], PASSWORD

DISCARDFILE /oradata2/ogg_19c/dirrpt/repebs.dsc, APPEND

---- DBOPTIONS ENABLE_INSTANTIATION_FILTERING

---- INSERTDELETES

map gg_admin.test2, target gg_admin.test2, colmap(usedefaults, operation_type = @CASE (@GETENV('GGHEADER', 'OPTYPE'), 'INSERT', 'I', 'DELETE', 'D','TRUNCATE','T', 'U'), timestamp = @GETEN

V('GGHEADER', 'COMMITTIMESTAMP'));

Extart Table

CREATE TABLE "GG_ADMIN"."TEST2" 

  ( "X" NUMBER, 

"Y" VARCHAR2(20 BYTE))

Extract Process

EXTRACT EXTNI

--- SETENV (ORACLE_HOME = '/oraccb/app/oracle/product/12.1.0.2/dbhome_1')

--- SETENV (TNS_ADMIN = '/oraccb/app/oracle/product/12.1.0.2/dbhome_1/network/admin')

USERID gg_admin , PASSWORD

TRANLOGOPTIONS DBLOGREADER

EXTTRAIL /u02/OGG_HOME/19.1/dirdat/en

GETUPDATEBEFORES

NOCOMPRESSDELETES

NOCOMPRESSUPDATE

table  gg_admin.test2;

Comments

  • ORASCN
    ORASCN Member Posts: 1,825 Gold Trophy

    Hi ,


    INSERTDELETES parameter is commented out. When the record is deleted in the target, how a flag will be set?

    ---- INSERTDELETES

    Regards,

    Veera

  • Omohei
    Omohei Member Posts: 169 Blue Ribbon

    Hi ,

    ---- INSERTDELETES , will add new record as the same exist one in replica table with flag D .

  • ORASCN
    ORASCN Member Posts: 1,825 Gold Trophy

    Hi ,

    In OGG, -- (double hyphen) means comment.

    In your parameter below, the parameter INSERTDELETES is commented out,

    ---- INSERTDELETES

    map gg_admin.test2, target gg_admin.test2, colmap(usedefaults, operation_type = @CASE (@GETENV('GGHEADER', 'OPTYPE'), 'INSERT', 'I', 'DELETE', 'D','TRUNCATE','T', 'U'), timestamp = @GETENV('GGHEADER', 'COMMITTIMESTAMP'));


    So, when a DELETE comes from source to target, the record will be deleted. Uncomment the parameter and retry it.


    Regards,

    Veera

    Omohei