Oracle uses Dblink and oracle uses dblink

Source: Internet
Author: User

Oracle uses Dblink and oracle uses dblink

The DBLINK database link is a schema object in a database, allowing you to access objects in another database.

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

New:

Method 1: Use the configuration file

Create database link "object Name" connect to "userName" identified by "password" using "server ";

Object Name: object Name userName: Remote database userName password: Remote Database password

Server: name of the configured Database Service,You need to create a service on the local server tnsname. ora.

Method 2:Write the remote database service location directly in the creation statement

Create database link esp_51Connect to esp identified by esp

Using '(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.1.105) (PORT = 1521 ))
)
(CONNECT_DATA =
(SERVICE_NAME = orcl)
)
)';

Example:

1.UPDATE teacher @ remoteSET salary = salary * 1.3WHERE last_name = 'std ';

2. Create a synonym for combination,Create synonym emp_tableFOR ys_adm.teacher @ remote;

For future use directly, select * fromEmp_table

3. Delete the DBLINK statement drop public database link remote;

 

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.