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:
- 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:
- 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:
- Create database link link_name connect to user identified by pass using
- '(DESCRIPTION=
- (ADDRESS_LIST=
- (PROTOCOL=TCP)(HOST= IP address of the computer where database 2 is located )(PORT=1521))
- )
- (CONNECT_DATA=
- (SERVICE_NAME=TEST2)
- )
- )';
- (Link_name: DB Link name; user: Database user Name; pass: Database Password ;)
-
Delete DB Link
Log on to SQL * PLUS and enter:
- 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.
- What is unknown about Oracle performance diagnosis?
- Oracle 10 Gb archive log
- Install Oracle9i and 10g on Windows2000 Server
- Code example of Oracle multi-Table query optimization
- Analyze the default port number modified by Oracle