Oracle Distributed Database

Source: Internet
Author: User

The database link of a distributed database is one-way

Defining Database Links
CREATE DATABASE LINK [Db_link_name] CONNECT to
[USER_NAME] identified by [password] USING ' [tns_name] ';

[Db_link_name]: is the service name of the database to which you want to connect, that is, the real name of the database (usually the SID).
[Usre_name]: is the name of the user you want to connect to.
[PASSWORD]: Is the password of the user you want to connect to.
[Tns_name]: is the service name of the database to which you want to connect.

1. First configure local name with local Net Manager

1. Open Net Manager
2. Expand Local and select service naming. Click the Plus + on the left side of the page:
3. The Network Service Name wizard appears. Enter a network service name, for example: REMOTEORCL. Click Next
4. Select the protocol to connect to the database. You can accept the default TCP/IP (network protocol) and click Next:
5. Enter the IP address of the remote database computer and click Next
6. Enter the SID of the remote database and click Next
7. The last page of the wizard enables you to test the connection with the information you enter
8. In the left tree menu, the service name we just configured will appear
9. Save the network configuration
10. To view the file C:\oracle\product\10.2.0\db_1\NETWORK\ADMIN\tnsnames.ora, have added the following:

    

2. Create a data link

Create DATABASE link L2 Connect to Scott identified by Tiger using ' REMOTEORCL '

3. Enquiry

Select Ename,dname

From dept, [email protected]

where Emp.deptno=dept.deptno;

L2 is the database link that you created earlier. 4, create aliases in order to query the distributed server convenient, you can create an alias created synonym emp1 for [email protected];

Select Dname,ename,sal

From EMP1, Dept

where Emp1.deptno=dept.deptno;

Oracle Distributed Database

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.