Oracle creates database link

Source: Internet
Author: User

Sometimes it takes a table join query in two databases to use the database link.

The role of database link is to build databases and database connections.

1. First look at how to create using the Pl\sql tool.

Locate the database links right-click New

Fill in the name, where the user name is the login name of the remote database

The database is the local file D:\oracle\product\10.2.0\client_1\NETWORK\ADMIN\tnsnames.ora

You can also fill in the database directly

(DESCRIPTION = (Address_list = (address= (protocol=tcp) (host=10.12.11.16) (PORT =1521))) (Connect_data = (service_name = ORC1)))

This is done after the save is created. Execute SQL Test

Select  *  from dual@test

2. You can also create a statement directly using the

Create Database  to by'(DESCRIPTION = (Address_list = (address= (protocol=tcp) ( host=10.12.11.16) (PORT =1521))) (Connect_data = (service_name =orc1)))';

Or

Create Database  to by ' T_tns ';

The tek_mes here is the database access account,123456 is the password

It is important to note that:

1. Create the permissions that must be created for the database link

2. Connection account (Tek_mes) must have create session permission

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.