PLSQL_Database Link basic concepts and usage (concepts), plsql_databaselink

Source: Internet
Author: User

PLSQL_Database Link basic concepts and usage (concepts), plsql_databaselink

2014-06-08 BaoXinjian

I. Summary

1. How to Establish a database connection

2. Query Method

3. Connection Type

4. Common queries

 

Ii. Detailed Analysis

1.How to Establish a database connection

(1). Use tns for Creation

Create database link linkname

Connect to user_name identified by password

USING tns_dbname

(2) directly establish

Create database link linkname

Connect to user_nameIDENTIFIED BY password

USING '(DESCRIPTION =

(ADDRESS_LIST =

(ADDRESS = (PROTOCOL = TCP) (HOST = 10.142.202.12) (PORT = 1521 ))

)

(CONNECT_DATA =

(SERVICE_NAME = dbname)

)

)'

 

2.Query Method

(1) directly use select * form tablename @ dblink

(2) create synonyms and search by synonyms

(3) Establish materialized views to improve execution efficiency

Create public synonym syn_name for tablename @ linknam

 

3.Connection Type

(1). Private

(2). Public

When establishing a common database connection, you must have sysadmin and sys accounts.

Create public database link linkname

Connect to user_name identified by password

USING tns_dbname

 

4.Common queries

(1) query all dblink connections of the Current Account

Select * from user_db_links;

(2) query all the dblink connections of the current system

Select * from dba_db_links

(3) query the currently connected dblink connection

Select * from v $ dblink

 

Thanks and Regards

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.