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