Oracle Database Link Synonyms

Source: Internet
Author: User
Database Link: The main purpose is to access the remote database. You can directly access the remote database through the database link.

Synonym: To make distributed operations more transparent, the Oracle database has a synonym object synonym. As its name implies, it is a synonym for an object and can be used instead of an object.

 

The database link creation syntax is generally:

Create database link [db_link_name] connect to [user_name] identified by [Password] Using '[tns_name]';

Where:

[Db_link_name]: Service name of the database to be connected, that is, the real name of the database (usually Sid ).

[Usre_name]: name of the user to be connected.

[Password]: the password of the user to be connected.

[Tns_name]: the service name of the database to be connected, that is, the net8 service name created on the local machine.

Usage:

Select * from [table_name] @ [db_link_name]; insert, update, and delete are the same.

 

Example:

Database Link

Create public database link Beijing connect to Scott identified by tiger using 'tobeijing ';

Then, a link Beijing with Scott user and Beijing database is created. We can query Scott data in Beijing:

Select * from EMP @ Beijing;

In this way, the data of Scott users in Shenzhen and Beijing can be processed as a whole.

 

Synonym

Create synonym bjscottemp for EMP @ Beijing;

Therefore, you can use bjscottemp to replace the Distributed Link operation with the @ symbol EMP @ Beijing.

 

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.