Forum Stats

  • 3,852,474 Users
  • 2,264,108 Discussions
  • 7,905,077 Comments

Discussions

Data sync in bi-directional

user10126973
user10126973 Member Posts: 187 Blue Ribbon

Hi All,

I have OGG replication is bi-directional from A database to B database(A <-------> B).

One of the tables is out of sync in database B, so I wanted to sync the data from A to B for that table, please share the best approach to sync the data(I have no verridata).

Regards,

DR

Best Answer

  • K.Gan
    K.Gan Member Posts: 2,815 Bronze Crown
    Answer ✓

    I don't know what setting the streams tag to 17 will do, tell me what is your aim? Although Oracle didn't tell us directly we know streams was repurpose for replication, that is why we see advice to set streams pool etc. If you have real inside knowledge of how streams is used for replication then yeah go for it. If you haven't guess I don't work for Oracle. 🤔

    Actually there is another way, impdp the table to some other table name, then drop the table at B, rename the table (ALTER) and set up whatever constraints, indexes etc. and comment all your DDL commands with /* IGNORE */ (or whatever). In the A replicat put DDL EXCLUDE INSTRCOMMENTS 'IGNORE'. These DDLs will not be done on A. In fact I will put this permanently in all your replicats, then you have a way to easily do DDL only on one node.

«1

Answers

  • AlexLima-Oracle
    AlexLima-Oracle Director of Product Management - GoldenGate Posts: 28 Employee

    Choose the side you consider the correct data and re-instantiate that table only. Go through the normal process to add a new table to an existing replication.

  • user10126973
    user10126973 Member Posts: 187 Blue Ribbon

    Hi AlexLima,

    I have these steps like I export the data with flasback scn from A and import into the B target database then start the replicate with Aftercsn , but the problem is whatever import the data B extract captures the data( then it replicated to A database. Now I am seeing duplicate data in A database for that tables

    how to handle this kind of situation as My environment enabled bi-directional.

    Regards,

    DR

  • ORASCN
    ORASCN Member Posts: 1,874 Bronze Crown

    Hello,


    You are encountering the looping issue. This comes in Bi-Directional replication. To avoid it, check the below link,

    You need to use TAG parameters in Extract and Replicat parameter files.

    In Replicat,

    DBOPTIONS SETTAG 0935
    

    In Extract,

    TRANLOGOPTIONS EXCLUDETAG 0935
    

    This avoids looping issues and your data will be in sync.

    Also, For bi-directional replication, we have a concept called "Trusted Source".

    Suppose for an example, Let us consider, Side A has a table with 12 columns and Side B has a table with 12 columns. Both have similar structure and they are in sync. Due to some issue, the replication got Abended and time to Re-Sync the data on both sides. On checking the tables on both the sides, the number of columns on both Side A table and Side B table are same. But the data of the columns of the table in Side A and Side B are different. Here comes the challenge, the Application team should decide, which side data should be considered. Either from the table in Side A or Side B. Here the selected table is considered as 'Trusted Source'. Like wise we have many things to be considered during the configuration of Oracle GoldenGate Bi-Directional.


    Regards,

    Veera

  • user10126973
    user10126973 Member Posts: 187 Blue Ribbon

    Hi Veera,

    Already TAG parameter is there on both sides site A and Site B. looks like the extract does not understand as I'm importing the data and it's treating new data that's it's why extract is capturing and replicating site B.

    it's not looping from site B to A.

    Regards,

    Veera.

  • ORASCN
    ORASCN Member Posts: 1,874 Bronze Crown

    Hello,


    May I know as what user you are exporting and importing the data?


    Regards,

    Veera

  • user10126973
    user10126973 Member Posts: 187 Blue Ribbon

    Hi Veera,

    Export and import User name dr12 3,

    Regards,

    DR

  • ORASCN
    ORASCN Member Posts: 1,874 Bronze Crown

    could you please share the parameter files of Extract and Replicat processes.


    Regards,

    Veera

  • K.Gan
    K.Gan Member Posts: 2,815 Bronze Crown

    From your statement you said B is out of sync so I do hope you are not having the application on B writing to this table and sending the updates to A. Then do these steps. Stop the replication for this table on both sides from original replicat. Expdp with scn (call this A<scn>),Impdp to B, when import finishes get a current_scn from B (call this B<scn>). Create temp replicats on both A and B for this table pointing to the original replicat trails with the closet extseqno. Start rep A, B<scn>, Start rep B, A<scn>. Run this for a while, then merge this back to the original replicat.

    * If you not sure how to merge replicats let me know

    * Tag only works for updates done by replicats not by external utility such as impdp. 12c impdp has a no logging feature but if force_logging is on it does not work. And you need force_logging for GG, duh!

  • user10126973
    user10126973 Member Posts: 187 Blue Ribbon

    Hi Gan,

    Thank you for all the big help, could you let me know how to merge replicats?

    Regards,

    DR

  • user10126973
    user10126973 Member Posts: 187 Blue Ribbon

    Hi Gan,

    would you suggest this while import (impdp) TRANSFORM=DISABLE_ARCHIVE_LOGGING:Y:TABLE

    looks like this impdp parameter would not generate for that problematic table as per oracle documentation.

    Regards,

    DR