Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.tools -> Re: problem with CREATE DATABASE LINK
Assuming OTHERPC is at IP address 123.124.125.126,
On your local pc, you have a TNSNAMES.ora file with the entry for the
otherPC.
example:
otherPC =
(DESCRIPTION =
(ADDRESS = (community = tcp)
(PROTOCOL = TCP)
(HOST = 123.124.125.126)
(PORT = 1521)
)
(CONNECT_DATA = (SID = OPC)
)
)
so, SQL> connect username/password_at_otherPC works fine
On your local database, you must also have a TNSNAMES entry for the otherPC.
example:
otherPC.world =
(DESCRIPTION =
(ADDRESS = (community = tcp)
(PROTOCOL = TCP)
(HOST = 123.124.125.126)
(PORT = 1521)
)
(CONNECT_DATA = (SID = OPC)
)
)
While still connected to local database, create the database link to the remote database (otherPC)
create database link OTHERPC.WORLD
connect to THATUSERNAME identified by THATPASSWORD
using 'otherPC'
/
then, on the local database:
select table_name from user_tables_at_OTHERPC.WORLD /
<tshbedford_at_my-deja.com> wrote in message news:91q3co$n9r$1_at_nnrp1.deja.com...
> Hi, > I must be doing something stupid. I can access a table on another PC > from SQL*Plus by typing 'connect scott/tiger @OtherPC'. Then 'SELECT * > FROM tablename' shows the expected results. > I want to do a search of a table on my PC with data taken from the table > on the other PC but I can't get a link to work. I can only ever > seem to be connected to one database or the other. Typing CREATE > DATABASE LINK linkname USING 'connect scott/tiger @OtherPC' says the > link is created but doing a 'SELECT * FROM tablename_at_linkname' it says > ORA-12154 :TNS:could not resolve service name. > > I'm an Oracle newbie, could someone tell me exactly what's wrong. Is > anything to do with both Oracle copies being Personal Edition? > > thanks, > > Tim > > > Sent via Deja.com > http://www.deja.com/Received on Wed Dec 20 2000 - 14:06:56 CST
![]() |
![]() |