In-depth Oracle DB Link Creation Method

Source: Internet
Author: User

Oracle DB Link is not known to most people. This article mainly introduces how to create Oracle DB Link. The following mainly lists two common solutions. Example:
Known: database 1: TEST1; database 2: TEST2
Requirement: Create a DB Link from database 1 to database 2

Solution 1:
1. on the computer where database 1 is located, create the service name to database 2: orl_test2
2. Create a database Link from database 1 to database 2 on database 1 or on other computers with ORACLE clients installed as follows:
* Log on to SQL * PLUS and enter:

 
 
  1. create database link link_name connect to user identified by pass using 'orl_test2';  

(Link_name: DB Link name; user: Database user Name; pass: Database Password; 'orl _ test2': name of the Database Service that locally connects to TEST1, enclosed in single quotes)
3. Delete the DB Link. The method is as follows:
* Log on to SQL * PLUS and enter:

 
 
  1. drop public database link link_name  

Solution 2:
Create a database Link from database 1 to database 2 directly on database 1 or other computers with ORACLE clients. The method is as follows:
Log on to SQL * PLUS and enter:

 
 
  1. Create database link link_name connect to user identified by pass using
  2. '(DESCRIPTION=
  3. (ADDRESS_LIST=
  4. (PROTOCOL=TCP)(HOST= IP address of the computer where database 2 is located )(PORT=1521))
  5. )
  6. (CONNECT_DATA=
  7. (SERVICE_NAME=TEST2)
  8. )
  9. )';
  10. (Link_name: DB Link name; user: Database user Name; pass: Database Password ;)
  11.  
Delete DB Link
Log on to SQL * PLUS and enter:

 
 
  1. drop database link LINK_NAME;  

I have posted my personal opinions on how to create an Oracle DB Link. For more information, please pay attention to the relevant forums on the website.

  1. What is unknown about Oracle performance diagnosis?
  2. Oracle 10 Gb archive log
  3. Install Oracle9i and 10g on Windows2000 Server
  4. Code example of Oracle multi-Table query optimization
  5. Analyze the default port number modified by Oracle

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.