Oracle 12c - PL/SQL Tables Replication Between Databases
Oracle 12c - PL/SQL Tables Replication Between Databases
1 Introduction
There are many ways to implement table/schema/database replication in Oracle databases. We won’t here explain native
Oracle RDBMS server replication funcionalities, like Oracle DataGuard, physical standby database, logical standby
database or Oracle Streams Replication. This brief report will consider pl/sql replication implementation based on limited
numbers of source database tables and using db links between source database and target database.
2 Chosen scenarios
We will refer just two scenarios:
incremental copy of data from source tables to destination tables
full copy of data from source tables to destination tables
1
Oracle 12c – PL/SQL tables replication between databases
4 Full copy
Full copy of source database tables on destination database is nothing else then executing procedures / packages
procedures INTIAL_COPY_PCK on scheduled timing. For example every week.
5 Options
Bulk insert is not supported trough database links
For that you need to use global temporary tables and we wouldn’t recommend that
Source: https://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:1001450700346544769
6 Conclusion
Regarding above,
we recommend next scenario for data replication trough database link:
1. Using Incremental copy option with (if possible unique sequence in tables) because DBMS_COMPARISON
package do synchronization in both databases by default.
2. Creating schedule DBMS_JOB or DBMS_SCHEDULER to automate process of synchronization between source
and destination tables.
3. Using PARALLEL hints is not option trough database links but it can be used
insert/*+ append */ into t_copy select * from t_original@mydb_link.com where id > l_copied_id;