Oracle---DBLink

Source: Internet
Author: User

This machine: 192.168.0.1

Remote host: 192.168.0.2


(1) Tnsnames.ora configuration on this machine is as follows

Orcl_2 = (DESCRIPTION = (Address_list = (ADDRESS = (PROTOCOL = TCP) (HOST = 192.168.0.2) (PORT = 1521))) (CO Nnect_data = (service_name = ORCL)))



(2) Create a database connection on this computer

CREATE DATABASE link Link CONNECT to backup identified by Backupusing ' orcl_2 ';



Note: Backup is a user on 192.168.0.2 and the password is backup


# # #查看存在数据库连接

Select Owner,object_name from dba_objects where object_type= ' DATABASE LINK ';


(3) test

SELECT * FROM [email protected];


# # #删除数据库连接

DROP DATABASE link link;


Create a public connection

CREATE public DATABASE LINK Link3connect to backup identified by backup USING ' orcl_2 ';


Public is the global Dblink, that is, all users on the database can query, to SYS or system users to create (of course, users with SYSDBA permissions); If you do not use public is a private dblink, Only the user who created the Dblink can query to see if the connection was successful.

SELECT * FROM [email protected]; SELECT * FROM [e-mail protected];## #删除公共连接DROP public DATABASE LINK LINK3;



This article is from the "Notes" blog, so be sure to keep this source http://sunflower2.blog.51cto.com/8837503/1678868

Oracle---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.