Implement data increment synchronization between two Oracle databases ____ Database

Source: Internet
Author: User
Tags create database

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 ');

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.