Two Oracle databases export data to each other

Source: Internet
Author: User

Case study:

There are two Oracle databases A and B, both of which are 10 Gb. How many pieces of data of one table in database a need to be inserted into one table in database B?

After checking on the Internet, you can create dblink on server a. Of course, the same is true on server B.

Open the sqlplus terminal or any Oracle client environment and execute the following SQL

CREATE DATABASE LINK
Connect to username identified by password
Using '(description = (address_list = (address = (Protocol = TCP) (host = IP address to be connected) (Port = 1521 ))) (CONNECT_DATA = (SERVICE_NAME = database Sid )))';

For example:

Create database link idtsxxzsp
Connect to sxxzsp identified by sxxzsp
Using '(description = (address_list = (address = (Protocol = TCP) (host = 199.66.68.15) (Port = 1521) (CONNECT_DATA = (SERVICE_NAME = IDT )))';

After the connection is established, you can access the tables of the Peer end through (table name @ Link name.

For example

Insert into designer_form1 select * From designer_form @ idtsxxzsp // insert all data from the remote designer_from table to the designer_form1 table in the connected database.

Insert into designer_form @ idtsxxzsp select * From designer_form where ID in (893,892,999) // you can insert local data to a remote database. (Supports large objects)

Therefore, this method can implement cases. The same applies to Oracle databases of different versions.

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.