|
Re: What is dblink? [message #83468 is a reply to message #83464] |
Tue, 14 October 2003 05:17 |
|
Maaher
Messages: 7065 Registered: December 2001
|
Senior Member |
|
|
In your tnsnames.ora, you have provided all the databases you want to connect to. It looks like this:firstdb.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(Host = some_host_or_IP_address)
(Port = some_port_usually_1521)
)
)
(CONNECT_DATA = (SID = FIRSTDB)
)
)
anotherdb.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(PROTOCOL = TCP)
(Host = some_host_or_IP_address)
(Port = some_port_usually_1521)
)
)
(CONNECT_DATA = (SID = ANOTHERDB)
)
) With a database link (dblink) you can, as the phrase says, link a database to another. You can, from one database, access objects of another database.
There are three types of database links: PRIVATE and PUBLIC. The private are created for one user only, the public, well...eur..are publicly known in the database, so any user in the local database can use them. The third is the GLOBAL database link, but that's only applicable if you're using Oracle Names.
Assume you want to access database ANOTHERDB from database FIRSTDB. In order to do so, create a database link from FIRSTDB to ANOTHER DB:SQL> CREATE DATABASE LINK Somelink CONNECT TO remote_user IDENTIFIED BY his_password USING 'ANOTHERDB'; Now you can access objects of remote_user like this:Select some_column
From his_table@somelink
Where ....
Here's a link for more info.
Search the oracle manuals: http://tahiti.oracle.com, that's where all the links come from. It requires a (spam-)free subscription.
MHE
|
|
|