Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: novice Oracle 9i tnslsnr problem
"Dieter A." <dieter_algemeinbung_at_excite.com> wrote in message
news:b9c3bfad.0301151409.66647221_at_posting.google.com...
> I'm an oracle novice and I've been trying to figure this tnslistener
> problem out for days with no luck.
> I installed Oracle 9i on Suse 8 linux. It works correctly except for
> the tnslsnr. When I try to tnsping $ORACLE_SID it won't work claiming
> used parameter file .../sqlnet.ora
> TNS-03505: Failed to resolve name
>
> however, when I tnsping localhost ,it works stating
> used .../sqlnet.ora
> used HOSTNAME adapter to resolve alias
> OK( 10msec )
>
> The files are below:
>
> tnsnames.ora
> ============
> MYDB =
> (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS =
> (PROTOCOL = TCP)(HOST = localhost)(PORT=1521)
> )
> )
> (CONNECT_DATA =
> (SERVICE_NAME=mydb)
> )
> )
>
If this is really how your tnsnames is formatted, then I'm not surprised it fails to resolve the name! All the indentation that Oracle's Net Assistant puts in this file is there for a reason (which some cynic is bound to say is 'just to make it hard to read'!). Point is, when you strip out all the indentation, it doesn't work.
I wrote a paper on this (well, not *just* this, of course!) a while back. It's still floating around the web somewhere, but I'm not allowed to tell you where, I'm afraid!
>
> sqlnet.ora
> ==========
> # SQLNET.ORA Network Configuration File: .../sqlnet.ora
> # Generated by Oracle configuration tools.
>
> NAMES.DEFAULT_DOMAIN = local
That means that if you type "connect fred/barney_at_WILMA", it gets passed on as "connect fred/barney_at_WILMA.local".
In your tnsnames, you have an alias for 'MYDB', connecting to a service called 'mydb'. So when you say 'connect x/y_at_MYDB', it will fail to resolve: the sqlnet.ora is appending '.local' onto the end of the supplied alias, and then Oracle's looking for an alias called "MYDB.local". Either edit your tnsnames to make the alias "MYDB.local", or get rid of this line out of sqlnet.ora altogether.
>
> NAMES.DIRECTORY_PATH= (TNSNAMES, ONAMES, HOSTNAME)
Not that it is the root cause of your problem, but do you really have a
choice of three names resolution methods? This line means 'I use a tnsnames
file, but if you can't find that have a look for an Oracle Names Server, and
if that doesn't work, try host name resolution". I doubt you do all three.
Trim it back to just TNSNAMES, for tidiness' sake if nothing else.
>
>
> listener.ora
> ============
> LISTENER = (ADDRESS_LIST= (ADDRESS=(PROTOCOL=tcp)
> (HOST=localhost)(PORT=1521)) (ADDRESS=(PROTOCOL=ipc)(KEY=PNPKEY)))
You sure enjoy mangling the layout of these files, don't you!
This won't work, because it's all over the place as a continuous line of text. Lay it out properly: and I see that Karsten has already posted explaining precisely how to do that.
Just one word: I hate seeing 'localhost' in a listener.ora, because how do you tell one apart from the other? Your machine has a proper TCP/IP address: use it.
Regards
HJR
Received on Wed Jan 15 2003 - 19:05:06 CST
![]() |
![]() |