Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Re: problem with CREATE DATABASE LINK

Re: problem with CREATE DATABASE LINK

From: TurkBear <noone_at_nowhere.com>
Date: Wed, 20 Dec 2000 15:32:43 GMT
Message-ID: <3a40d020.71555621@spamkiller.news-ituk.to>

tshbedford_at_my-deja.com wrote:

>In article <91q51k$og6$1_at_nnrp1.deja.com>,
> Lev Smirnov <leo_at_dionis.sura.com.ru> wrote:
>> In article <91q3co$n9r$1_at_nnrp1.deja.com>,
>> tshbedford_at_my-deja.com wrote:
>> > 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/
>> >
>> Try this:
>> CREATE DATABASE LINK linkname CONNECT TO scott IDENTIFIED BY tiger
>> USING OtherPC.
>>
>> If the GLOBAL_NAMES parameter is set to TRUE, linkname should matches
>> the global name of your remote database.
>>
>> Lev Smirnov
>> Brainbench MVP for Oracle Admin
>> http://www.brainbench.com
>>
>> Sent via Deja.com
>> http://www.deja.com/
>>
>How do I find out what GLOBAL_NAMES is set to? And how do I change it?
>Both databases have the default ORCL name. Surely that can't be the
>problem.
>I tried the '.....USING otherPC' command but get back 'Not connected'.
>
>Tim
>
>
>Sent via Deja.com
>http://www.deja.com/

Oracle will tell you if the global_names is the problem...if it can find the instance, based on the link, and the global_name is set to true, a message will be generated stating that the database link name is different form the global name, and will give you the global name...Your problem is in the create link statement..

Use this

( quotes are important )

create database link linkname connect to scott identified by tiger using 'OtherPc'

Use the same connect string you used when the connect scott/tiger_at_OtherPc worked... Received on Wed Dec 20 2000 - 09:32:43 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US