error in c onnect : ORA-12154

Nelson Ng

Member²
I have an program that access an Oracle 8i database using DOA 3.4.

In some PCs, when run the program, an error occured :
ORA-12154 TNS: Could not resolve service name

We tried other Oracle tools e.g. SQLPlus, Net Assistant and tngping. They connect fine.

Does anybody has any ideas? Please help

Thanks,
Nelson
 
Make sure that the tnsnames.ora from your Primary (!) Oracle Home is setup correctly.

If SQL*Plus works correctly and your Direct Oracle Access application causes an ORA-12154, then you have either misspelled the LogonDatabase, or SQL*Plus is running from a different Oracle Home than your application.

------------------
Marco Kalter
Allround Automations
 
It is from a different home (not the default)
but I've set it as the default database using Home Selector. Since I cannot modify the registry, is there any command to change and check the default home
 
Hi,

I got access to the registry and find
there is multiple home and the default one
is now pointing to the one SQLplus works.

However, if I run the DOA program, the same error still occurs.

Do you have any idea ?

Regards,
Nelson.
 
The default oracle home is not the same as the primary oracle home. You can use the Oracle Home Selector (a standard Oracle utility, available in the Oracle start menu) to set the primary oracle home. As a result the oracle_home\bin directory will be listed first in the PATH environment variable.

------------------
Marco Kalter
Allround Automations
 
I've done exactly what you said but still fail.
FYI, there are 2 Oracle Home : one is 8.1.7,
one is 8.0.6

The installation (not by me) history is :
1. 8.0.6 Oracle form
2. 8.1.7 client (by renaming the 8.0.6 directory and clear registry first and install again)

server is 8.1.7
I've checked character set and default home in registry and the path is the 8.1.7 bin first.

Nelson.
 
Still waiting for reply,
any idea or any additional information I can check ?

BTW, in registry, under
ORACLE\ALL_HOMES\
there are ID0, ID1, ...
while under ORACLE\
there are HOME0, HOME1, ...

All of them have NLS_LANG parameters,
but some are "NA", some are standard NLS_LANG format.

If, say default home, is to connect to a database with different dataset,
which registry entries should I change or just "NA" for all cases ?
 
If SQL*Plus from your Primary Oracle Home can connect to database X, then so can Direct Oracle Access. This is all handled by Net8.

If it seems that this is not the case, then please make absolutely sure that the database you are trying to connect to is spelled correctly, that the Primary Oracle Home is setup correctly and is being used by Direct Oracle Access (Oracle > Info menu), and that your SQL*Plus verification is in fact performed by the SQL*Plus version from the Primary Oracle Home.

------------------
Marco Kalter
Allround Automations
 
I'm getting the same problem, but I want to access a 9.0.1 Oracle database.
"ORA-12154 TNS: Could not resolve service name"

The bug not always appear. Sometimes I connect and it is ok, others give me the problem above.

When the bug appears I can do tnspings that indicate what tnsnames and sqlnet files is using, I do logins using sqlplus. The path name begins with c:\oracle\ora90\bin, has required in previous posts.

My ocidll in preferences is set to "C:\oracle\ora90\bin\oci.dll" is this correct or I have to use other dll?

Any ideas about what is happening?

Thanks!!!
 
Perhaps you can enable Oracle Net tracing through the sqlnet.ora configuration file, and check the log file when this error occurs?

If you are using the Oracle Names Server, then maybe you are running into this bug .

------------------
Marco Kalter
Allround Automations
 
Back
Top