简体   繁体   中英

2 way replication on tables with trigger in oracle database

what is the best way to replicate tables from oracle database on primary server to similar database on secondary server and vice versa. i have tried using oracle streams but issue is i have triggers on tables and my requirement is to replicate data from these tables to database on secondary server and vice versa.As soon as the data is inserted in tab1 of sourceDB same is updated in tab2 of destiDB also the trigger on tab1 of destieDB gets triggered .This triggers should not triggered

basic idea being data availability.

Please suggest if this is correct way or i need to use some other way

You can use GoldenGate with SUPPRESSTRIGGERS option. But it depends on your oracle version (not working on 11.1).

Adding DBOPTIONS SUPPRESSTRIGGERS to your replicat process configuration will prevent the trigger being executed on the target DB.

You could code the triggers in a way you can disable it on a per User or per Session basis see Stack Overflow: Disable Trigger per Session

But the better solution for a variety of concurrency and data consistency problems would be to use a professional backup/mirroring solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM