Oracle uses Dblink

Source: Internet
Author: User

The Dblink database link is a schema object in a database that allows you to access objects on another database.

The Dblink qualifier allows you to reference objects in a database other than the local database, and if Dblink is omitted, Oracle assumes that you are referring to an object in the local database, and not all SQL statements allow you to access objects on the remote database.

New:

Method One: with configuration files

Create DATABASE Link "Object Name" connect to "UserName" identified by "password" using "Server";

Object name: UserName: The user name of the remote database password: password for the remote database

Server: The configured database service name, a service needs to be established on the local server Tnsname.ora.

Method Two: write the remote database service location directly in the CREATE statement

CREATE DATABASE link esp_51    Connect to ESP identified by ESP

Using ' (DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.105) (PORT = 1521))
)
(Connect_data =
(service_name = ORCL)
)
)‘;

Application Examples:

1.UPDATE [email protected] SET salary=salary*1.3 WHERE last_name = ' stu ';

2. Create synonyms for merge use, CREATE synonym emp_table for [email protected];

For future direct use, select * from emp_table

3. Delete the Dblink statement drop public DATABASE LINK remote;

Oracle uses Dblink

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.