-3

I have two tables table1 in local system and table2 on another system. I created database link to table2 in local sytem I.e table2@anothersystem

I have two columns in both tables ID (number) & NAME (varchar). I want to execute any query on table1 such that after it's execution in table1 it will also be identically executed in table2.

In short I want to keep table1=table2. can anybody suggest trigger for it in Oracle 11g

Sathyajith Bhat
  • 21,321
  • 22
  • 95
  • 134
  • 5
    It seems highly unlikely that you'd want to use a trigger to keep the tables in sync. That would severely reduce your system's availability-- if the remote database or the network was down, the local transaction would fail. It would probably add a substantial performance overhead to do the network traffic and the two-phase commit. Oracle provides a number of technologies (Streams, materialized views, Golden Gate, etc.) to replicate data. Rolling your own rather than using one of these technologies is almost always a mistake. – Justin Cave Jan 28 '15 at 18:22

1 Answers1

0

As @justin-cave already mentioned, using triggers is definitely not the way to go. I'd opt for a materialized view (the cheap option). Check Oracle materialized view question for a starting point. When you have the appropriate license you could create a logical or physical standby database, or other Oracle-provided data replication options.

Community
  • 1
  • 1
Non Plus Ultra
  • 867
  • 7
  • 17