Understanding of database link and the same term

Source: Internet
Author: User
Database link Function
Database link, which makes it easier for a database to access another database (both local and remote). At the beginning, many people may misunderstand it, it is actually created locally. That is, the database connection is just a shortcut to connect to another database.

I. zhujianDatabase Link

First:

1. Use Net manager to configure remote services and listeners based on remote information.Program.
2. Create public database link fwq12

Connect to fzept identified by Neu
Using   ' Fjept '   // Fjept is the service name Just configured

Second:
Directly create a link:

Create database link linkfwq
Connect to fzept identified by Neu
Using   ' (Description =
(Address_list =
(Address = (Protocol = TCP) (host =   192.168 . 254.132 ) (Port =   1521 ))
)
(CONNECT_DATA = (Server = Dedicated)
(SERVICE_NAME = SH2)
)
) ' ;

Note: If you have created a connector in the tnsnames. ora file, you do not need to create a DB link.
If you create a global dblink, you must use the mongom or sys user to add public to the database.

Ii. Use dB Link

Query tables in a remote database

Select ...... From table name @ Database Link name;

Querying, deleting, and inserting data are the same as operating a local database, except that the table name must be written as "table name @ dblink name.

Iii. Remove dB Link Delete dblink: Drop public database link linkfwq.

3. Synonyms

Create:

Create synonym name for table name;
Create synonym name for table name @ Database Link name;

Except:

Drop Synonym Synonym name ; Exam: http://www.techrss.cn/html/2008/03-12/77859.htm

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.