Perform operations on remote databases in Oracle (Distributed Database processing)

Source: Internet
Author: User

Recently encountered a problem: Adding and changing data to a table in another remote database in an Oracle database
The customer requested that the two tables be synchronized on a regular basis, and began to prepare for writing them into the Windows service form. In case of any trouble, he searched the internet and found a way to change the data to the remote database.

Configure the remote database in TNS
Proxy name: temporary name given to the remote user table
User name and password: the user name and password of the tablespace you want to connect
Primary service name: The Sid you configured in TNS
Format:

Create   Database Link proxy name connect To User name identified By Password using ' Main service name '

For example:Create DatabaseLink Kenshin connectToZdt identifiedByZdt using'Jndb';

Check whether the link is set up:Select * FromUser_db_links

After completing the preceding steps, you can operate the remote ORACLE database table in the database.
For example:

Select   *   From Dual @ Kenshin

Recently, the most important thing is to commit transactions after the update, insert into, and delete statements; otherwise, distributed transactions cannot be committed!Delete FromDual;
Commit;

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.