Using DB link two steps to synchronize table data between Oracle two databases

Source: Internet
Author: User

This method enables synchronization of tables with two different versions of Oracle, and is more efficient than IMP statement-guided DMP.

first, achieve the goal:
To implement data synchronization from the source table (AAA) to the target table (BBB).

Second, establish Oracle DB Link on the target machine:

1, in the Network/admin/tnsname.ora file to add the source Library connection information, such as:

Aaa=
  (DESCRIPTION = (Address
    = (PROTOCOL = TCP) (HOST = 10.5.1.3) (PORT = 1521))
    (Connect_data =
      (SERVER = D edicated)
      (service_name = AAA)
    )
  

2, on the target machine with plsql tool or Sqlplus user/pwd login Target library (BBB).
3, with the following command and Source Library (AAA) to establish DB Link:

Create Public database link Aaa_link connect to user identified by PWD using ' AAA ';

Command Description:
CREATE Public Database links Database link name CONNECT to username identified by password USING ' locally configured data ' instance name ';
If successful, you will be prompted: Database link created.

Using the following script, you can synchronize the data table:

TRUNCATE TABLE C;
Insert into the C
select * from AAA. C@aaa_link; #这里是指向要同步的来源表, the table name must be < table owner >.< table name >@<dblink name>
commit;

PS: Need DB support advanced replication function, whether support, can be viewed as follows SQL:

SELECT * from v$option where parameter= ' Advanced replication ';
If you return true, support is supported.

Original address

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.