Forum Stats

  • 3,780,843 Users
  • 2,254,446 Discussions
  • 7,879,482 Comments

Discussions

Problem replicating a table with more columns in the target table.

User_7H4F9
User_7H4F9 Member Posts: 4 Green Ribbon

MASTER TABLE:

CREATE TABLE TEST.MY_TABLE

( COL1  NUMBER(10),

 COL2  VARCHAR2 (5 BYTE),

 COL3  VARCHAR2 (5 BYTE))

...

CREATE UNIQUE INDEX TEST.UI_MY_TABLE ON TEST.MY_TABLE(COL1)

...



TARGET TABLE:

CREATE TABLE TEST.MY_TABLE

( COL1  NUMBER(10),

 COL2  VARCHAR2 (5 BYTE),

 COL3  VARCHAR2 (5 BYTE),

 ID   NUMBER(10) Generated as Identity (START WITH 1 MAXVALUE 9999999999 MINVALUE 1 NOCYCLE CACHE 20 NOORDER NOKEEP))

...

CREATE UNIQUE INDEX TEST.UI1_MY_TABLE ON TEST.MY_TABLE(COL1)

CREATE UNIQUE INDEX TEST.UI2_MY_TABLE ON TEST.MY_TABLE (ID)

...



Extract:

extract extra1

exttrail ...

setenv ...

useridalias ...

GETUPDATEBEFORES

GETTRUNCATES

SOURCECATALOG ...

table TEST.MY_TABLE;


Pump:

extract pump1

rmthost ...

rmttrail ...

passthru

table *.*;



Replicat:

replicat repli1

useridalias ...

GETUPDATEBEFORES

GETTRUNCATES

HandleCollisions

--assumetargetdefs

--map *.*, target *.*;

map TEST.MY_TABLE, target TEST.MY_TABLE, COLMAP (USEDEFAULTS, ID = ??????)



i tried a lot... i'm always getting "Error in COLMAP clause" or "Key column ID is missing from map".


Any idea how can i do this?

Thanks in advance.

Best Answers

  • ORASCN
    ORASCN Member Posts: 1,825 Gold Trophy
    Accepted Answer

    So, do you need to exclude that column from replication?

    or

    Do you need to provide a static value to that column excluding from automatic mapping?


    Regards,

    Veera

  • User_7H4F9
    User_7H4F9 Member Posts: 4 Green Ribbon
    edited Nov 27, 2021 9:38PM Accepted Answer

    I needed to exclude that column from replication, but i finally found a workaround.

    Here is what it worked for me. If someone ever needs it, add this to the replicat:

    MAP TEST.MY_TABLE, target TEST.MY_TABLE, KEYCOLS(COL1) COLMAP (USEDEFAULTS, [email protected](MISSING));

    Thanks!.

Answers