Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Database link
I need more information to answer this question:
If you are running sql*net 2.x or higher on your machine, the server you
are accessing
needs to also run sql*net 2.x or higher. You need to check to see if you
have a
tnsnames.ora file. If you or your dba installed sql*net successfully and
configured
it, the tnsnames.ora file usually defaults into the
$ORACLE_HOME/network/admin
directory, unless your dba has moved it to a different location. If so,
they should
have set up an environment variable $TNS_ADMIN. The server's information
you
are attempting to access should have an entry in the tnsnames.ora file.
Example
below:
abcdb.world =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS =
(COMMUNITY = tcp.world)
(PROTOCOL = TCP)
(Host = Production1)
(Port = 1521)
)
Host = either the ip address of the remote server or the hostname of the
remote server
SID = the database name for the remote server
When you create the database link, you will need to provide the alias for
the node
you are accessing in the "using" statement:
create database link abc
connect to scott identified by tiger
using 'abcdb.world';
Then, you can select from scott's table on the other server:
select * from scott.emp_at_abc;
Hope this helps.
Vidar Mikkelsen wrote:
> I want to perform selection from tables in an other database. > I've tried to create a database link , but it does not work, tns error. > How can i set up sqlnet to reach a DB on antoher Unix machine ?? > > VidarReceived on Thu Jun 04 1998 - 10:42:06 CDT
![]() |
![]() |