ORA-12154 TNS could not resolve service name through Automa

Giganews Newsgroups
Subject: ORA-12154 TNS could not resolve service name through Automa
Posted by:  ShadowAssassin (tariq.khan@gmail-dot-com.no-spam.invalid)
Date: Tue, 15 Nov 2005

Hello

Oh no! not another 12154! This one is different, I promise, and
would really be grateful for any help

---------------------------------------------------------------------------------
MY QUESTION
---------------------------------------------------------------------------------
I can't connect to my Oracle9i database when the connection request i
made via automation, i.e. I have Visual Basic call another dll whic
inturn makes an ODBC connection request. (Making direct connection
on the other hand works.

When I try I get the following error message
> state was 08004, code 12154, message [Oracle][ODBC][Ora]ORA-12154
TNS:could not resolve service name[ODBC][Ora]ORA-12154: TNS:could no
resolve service name[/quote:0498496778
What could be wrong

---------------------------------------------------------------------------------
ADDITIONAL INFO
---------------------------------------------------------------------------------
In my case, the connection request takes place in the followin
manner
Visual Basic --> (D)COM service for R -->  R --> DLL --
ODBC API --> Oracle API --> SQL*NET --> SQL Listener --
databas
* R is an open source programming language for statistic

MAKING DIRECT CONNECTION REQUESTS WOR
I can connect fine using sqlplus; tnsping works; opening in TOA
works. I can connect to the DB directly using VB or using R

My TNSNAMES.ora

          FPL_DATA
              (DESCRIPTION
              (ADDRESS_LIST
                      (ADDRESS = (PROTOCOL
TCP)(HOST = server.name.removed)(PORT
1521)

              (CONNECT_DATA
                      (SERVICE_NAME = DATA001

sqlnet.ora contains
[code:1:0498496778]
SQLNET.AUTHENTICATION_SERVICES=(none
              NAMES.DIRECTORY_PATH
(TNSNAMES)[/code:1:0498496778

When i tnsping, I can see that its accessing the correct file and
made sure I removed all other files with the same name on my loca
drive. I checked that the port works through telnet: fine

SECURITY ISSUES
I thought that the context and security issues might have something t
do with it. The automation is run through a (D)COM service, and I hav
checked through dcomcnfg that the process is running as me. I hav
also made sure 'Everyone' as access to C:\oracle\ora92\ and all o
the relevant subdirectories. Registry entries are similarl
free-for-all so that anybody would have sufficient priviledges

OTHER DRIVERS TO TRY
When I try using the Microsoft Oracle dataprovider I get a generi
error
> state was NA000, code 6413, message [Microsoft][ODBC driver fo
Oracle][Oracle]ORA-06413: Connection not open.[ODBC driver fo
Oracle][Oracle]ORA-06413: Connection not open.[/quote:0498496778

SQL NET TRACE FILE
There are two tracefiles. The first one is exactly the same as whe
you have a successful connection. I have used the tracefiles to prov
that querying of the tnsnames.ora file is successful. Here is a
excerpt
> (3124) [11-NOV-2005 16:29:22:352] nnftqnm: Using tnsnames.or
address (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL
TCP)(HOST = server.name.removed)(PORT = 1521))) (CONNECT_DATA
(SERVICE_NAME = DATA001))) for name FPL_DATA nnftqnm: Usin
tnsnames.ora address (DESCRIPTION = (ADDRESS_LIST = (ADDRESS
(PROTOCOL = TCP)(HOST = server.name.removed)(PORT = 1521))
(CONNECT_DATA = (SERVICE_NAME = DATA001))) for nam
FPL_DATA[/quote:0498496778

The Second file contains
> (3720) [11-NOV-2005 17:12:55:442] --- LOG CONFIGURATION INFORMATIO
ENDS --
>
> (3720) [11-NOV-2005 17:12:55:442] ntvllt: entr
> (3720) [11-NOV-2005 17:12:55:442] ntvllt: exi
> (3720) [11-NOV-2005 17:12:55:442] nigini: entr
> (3720) [11-NOV-2005 17:12:55:442] nigini: Count in NI global are
now:
> (3720) [11-NOV-2005 17:12:55:442] nigini: Count in NI global are
now:
> (3720) [11-NOV-2005 17:12:55:442] nrigbi: entr
> (3720) [11-NOV-2005 17:12:55:442] nrigbni: entr
> (3720) [11-NOV-2005 17:12:55:442] nrigbni: Unable to get data fro
navigation file tnsnav.or
> (3720) [11-NOV-2005 17:12:55:442] nrigbni: exi
> (3720) [11-NOV-2005 17:12:55:442] nrigbi: exit
> (3720) [11-NOV-2005 17:12:55:442] nigini: exit
> (3720) [11-NOV-2005 17:12:55:442] niqname: Hst is already an
NVstring.
> (3720) [11-NOV-2005 17:12:55:442] niqname: Inserting CID.
> (3720) [11-NOV-2005 17:12:55:442] nigtrm: Count in the NI global
area is now 0  [## A successful log-in is different from here on -
should say 'niotns: entry' ##]
> (3720) [11-NOV-2005 17:12:55:442] nrigbd: entry
> (3720) [11-NOV-2005 17:12:55:442] nrigbd: exit
> (3720) [11-NOV-2005 17:12:55:442] nigtrm: Count in the NL global
area is now 0 nigtrm: Count in the NL global area is now
0[/quote:0498496778]
I am pretty certain the problem occurs BEFORE a TCP request but AFTER
the alias has been successfully resolved from the TNSNAMES.ora file.
I dont care how to get it to work, i just want to see that beautiful
connection come together! Experts, Please help :-)!!

-Tariq

Replies