Data incremental synchronization is implemented in two databases so that data between databases can be updated synchronously.
Oracle Database ip:192.168.0.1 (Source library), 192.168.0.2 (Target library)
1. Create test table in Source Library
CREATE TABLE TEST (ID number not NULL, NAME VARCHAR2 (200));
2. Insert a piece of data
INSERT into TEST (id,name) VALUES (1, ' 1111 '); commit;
3. Create materialized view Log table in Source Library
Create materialized view Log on TEST with ROWID;
4. Create a dblink link in the target library
Create DATABASE link Dblink_testconnect to username identified by "123456" using "(DESCRIPTION = (address = (PROTOCOL = TCP) (HOST = 192.168.0.1) (PORT = 1521)) (Connect_data = (SERVER = dedicated) (service_name = ORCL))) ;
5, in the target library to create a TEST table in the Source Library materialized visual graph Mv_test
Create materialized view Mv_testrefresh fast on Demand with ROWID as SELECT * fromtest@dblink_test; When the table is created, the number in the source table is According to the synchronization come over;
6, Manual execution synchronization
Call Dbms_mview.refresh (' mv_test ');