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

Home -> Community -> Usenet -> c.d.o.server -> Re: Can't connect to remote database

Re: Can't connect to remote database

From: Howard J. Rogers <howardjr_at_www.com>
Date: Tue, 6 Feb 2001 06:56:41 +1100
Message-ID: <3a7f0577@news.iprimus.com.au>

OK, well you tnsnames.ora explains why the connect "@db1" works -because db1 is the tns alias for the ORCL sid, and the .ora file explains nicely where and how to connect there.

When you just connect as User1, though, you really ARE relying on ORACLE_SID, and since that's set to ORCL, and since your tnsnames.ora says not one word about how to connect to something called ORCL, it can't.

A couple of things to try. First edit the tnsnames, and change the line where it says db1= to read ORCL=. See how you get on then. Try a connect User1/password and note the results. And then try a connect User1/password_at_ORCL and again note the results.

If that works, you could try cutting and pasting the 9 lines you've shown here, and then editing that same line again, so that you end up with one set of lines saying "db1 = " and one set of lines reading "ORCL =". You should then have the choice of what name you wish to connect by (though both will actually connect to the ORCL Instance.

Let me know how you get on

Regards
HJR <paul_rogers6_at_my-deja.com> wrote in message news:95m94g$lvp$1_at_nnrp1.deja.com...
> Thank you for your prompt reply
>
> My tnsnames.ora is as follows:
>
> # TNSNAMES.ORA Network Configuration
> File: /oracle/mowlem01/OraHome1/network/admin/tnsnames.ora
> # Generated by Oracle configuration tools.
>
> db1 =
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS = (PROTOCOL = TCP)(HOST = 10.81.22.56)(PORT = 1521))
> )
> (CONNECT_DATA =
> (SID = ORCL)
> )
> )
>
> I set this up based on one which is used by a third party s'ware
> product to access the same database. We usually install the client on
> the (Windows 95) machine and copy the tnsnames.ora file onto it. I
> tried this with the linucx client but with no success whatsoever. This
> is as follows:
>
> #This is a SQL*Net Configuration file generated by SQL*Net Easy
> Configuration.
> #Attention: Do not modify this file yourself.
> #If you do, your SQL*Net Easy Configuration may not function properly.
>
> Example1.world =
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS =
> (COMMUNITY = tcp.world)
> (PROTOCOL = TCP)
> (Host = Production1)
> (Port = 1521)
> )
> )
> (CONNECT_DATA = (SID = SID1)
> )
> )
> Example2.world =
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS =
> (COMMUNITY = spx.world)
> (PROTOCOL = SPX)
> (Service = Server_lsnr)
> )
> )
> (CONNECT_DATA = (SID = ORCL)
> )
> )
> Example3.world =
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS =
> (COMMUNITY = nmp.world)
> (PROTOCOL = NMP)
> (Server = FinanceServer1)
> (Pipe = ORAPIPE)
> )
> )
> (CONNECT_DATA = (SID = ORCL)
> )
> )
> Tcp-loopback.world =
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS =
> (COMMUNITY = tcp.world)
> (PROTOCOL = TCP)
> (Host = 127.0.0.1)
> (Port = 1521)
> )
> )
> (CONNECT_DATA = (SID = ORCL)
> )
> )
> Beq-Local.world =
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS =
> (COMMUNITY = beq.world)
> (PROTOCOL = BEQ)
> (PROGRAM = oracle73)
> (ARGV0 = oracle73ORCL)
> (ARGS = '(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))')
> )
> )
> (CONNECT_DATA = (SID = ORCL)
> )
> )
> db1.world =
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS =
> (COMMUNITY = tcp.world)
> (PROTOCOL = TCP)
> (Host = 10.81.22.56)
> (Port = 1521)
> )
> (ADDRESS =
> (COMMUNITY = tcp.world)
> (PROTOCOL = TCP)
> (Host = oracle_server)
> (Port = 1526)
> )
> )
> (CONNECT_DATA = (SID = ORCL)
> )
> )
>
> I apologise if this all seems very basic (or stupid :-)) but I'm trying
> to progress this matter with very little prior knowledge.
>
> Do you have any further suggestions as to what might be wrong?
>
> Paul
> In article <3a7e730e$1_at_news.iprimus.com.au>,
> "Howard J. Rogers" <howardjr_at_www.com> wrote:
> > The fact that a "...._at_something" works and a "....nothing" doesn't
 strongly
> > suggests that it is your tnsnames.ora that is up the spout.
> >
> > The further fact that your ORACLE_SID is set to ORCL, but you then
 seek a
> > connection to something called DB1 is also interesting -what the hell
 are
> > you actually trying to connect to???!! Your Instance is clearly
 called DB1,
> > yet you expect an unqualified connect string to somehow magically
 know that
> > you are trying to connect to DB1, when the thing which provides the
 default
> > Instance name (ORACLE_SID) is set to something completely different.
> >
> > So: Step 1. If there really is an Instance called ORCL to which you
 wish to
> > connect, it needs to be referenced in your tnsnames.ora (host, port
 and SID
> > would do for a start).
> >
> > Step 2. If there ISN'T an ORCL Instance, and the real thing is
 called DB1,
> > try changing your ORACLE_SID environment variable to read DB1 (in
 Unix, type
> > "export ORACLE_SID=DB1", no spaces, no quotes).
> >
> > Remember: ORACLE_SID merely provides the default Instance name to
 which
> > unqualified connect strings should attempt a connection. Either you
 rely on
> > ORACLE_SID, or you use the @Something syntax to provide an explicit
 Instance
> > Name to which a connection should be made.
> >
> > Regards
> > HJR
> >
>
>
> Sent via Deja.com
> http://www.deja.com/
Received on Mon Feb 05 2001 - 13:56:41 CST

Original text of this message

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