?
Solved

ORA-12154: TNS:could not resolve service name

Posted on 2006-06-13
14
Medium Priority
?
2,516 Views
Last Modified: 2008-01-09
Hi All, I am developing an ASP.net 1.1 website

because recently I've reinstalled winxp, so I've to install all application again
I could set up the website and oracle client again
but I have this error --> "ORA-12154: TNS:could not resolve service name " when it connects to DB

I can connect to DB with toad
I have the file tnsname.ora already
I have uncheck and check Read & Execute for Authenticated User for C:\Oracle\Ora92
I have added ASP.net privilege to C:\Oracle\Ora92 already

any ideas for how to fix this?

thanks a lot!!!
0
Comment
Question by:orbulat
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
14 Comments
 
LVL 23

Expert Comment

by:paquicuba
ID: 16899088
Do you more than one Oracle Home, such as Developer suite and client?
0
 
LVL 23

Accepted Solution

by:
paquicuba earned 1400 total points
ID: 16899096
Do some network connection testing using tnsping:
 
i.e.  to tnsping my PROD database

C:\>tnsping PROD

TNS Ping Utility for 32-bit Windows: Version 10.2.0.1.0 - Production on 13-JUN-2
006 21:26:04

Copyright (c) 1997, 2005, Oracle.  All rights reserved.

Used parameter files:
C:\oracle\product\10.2.0\db_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = Paqui)(P
ORT = 1521)) (CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = PROD)))
OK (50 msec)                                                                                                                        --<<--------- OK


   
0
 
LVL 10

Author Comment

by:orbulat
ID: 16899134
I've only installed one oracle client, only one oracle home

yes, i've tried tnsping, and able to connect to my DB, but I am not using sqlnet.ora
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 23

Expert Comment

by:paquicuba
ID: 16899207
Can you post your TNSNames.ora file?

Where did you place it?

Have you by any chance created an TNS_ADMIN key under HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE?
0
 
LVL 10

Author Comment

by:orbulat
ID: 16899297
TNSNames.ora is placed
C:\oracle\ora92\network\admin

Have you by any chance created an TNS_ADMIN key under HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE? <-- couldn't find this key
0
 
LVL 23

Expert Comment

by:paquicuba
ID: 16899317
That key is often created when you have more than one home to manage and want to place the tnsnames.ora file in a central location, so don't worry about it. Your TNSNAMES.ora is in the right directory.

Under HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE, can you see ORACLE_SID?  If Yes, is it pointing to your SID?

Do you have more than one database?





0
 
LVL 10

Author Comment

by:orbulat
ID: 16899337
I couldn't find ORACLE_SID under HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE

I only have one DB

it's weird that I can connect to the DB with toad, but not with my asp.net website

0
 
LVL 23

Expert Comment

by:paquicuba
ID: 16899349
The key should be under HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME<?>    Could be HOME0 or any other alias

>>>it's weird that I can connect to the DB with toad, but not with my asp.net website

Yes it is.

It also could be caused by a firewall. Try disabeling your firewall.

Can you connect to SQL*Plus?
0
 
LVL 10

Author Comment

by:orbulat
ID: 16899417
The key should be under HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\HOME<?>    Could be HOME0 or any other alias

oh, i can't find the key "ORACLE_SID" under HOME0
0
 
LVL 10

Author Comment

by:orbulat
ID: 16899449
if using SQLPlus

my steps are like this -->

sqlplus /nolog

connect userid/pwd@myDB
0
 
LVL 16

Assisted Solution

by:MohanKNair
MohanKNair earned 200 total points
ID: 16899875
Are you specifying ORACLE_HOME in the ASP program before connecting using the TNS alias?

Verify that the local ASPNET account has all permissions on ORACLE_HOME folder and also its sub-folders.

Once again verify read permission for C:\oracle\ora92\network\admin\tnsnames.ora and C:\oracle\ora92\network\admin\sqlnet.ora files.

Login as ASPNET account

C:> TYPE C:\oracle\ora92\network\admin\tnsnames.ora

C:> TYPE C:\oracle\ora92\network\admin\sqlnet.ora
0
 
LVL 3

Assisted Solution

by:haidersyed
haidersyed earned 200 total points
ID: 16899928
you can visit

http://www.findabout.net/Technology/IT/oraerror.htm#ORA-12154:%20TNS:could%20not%20resolve%20service%20name 
for all possible TNS errors
or

http://www.findabout.net/Technology/IT/oraerror.htm

thanks

However this could be because of multiple oracle homes, invalid domain name in sqlnet then tns file , inaccessable tnsfile etc.
0
 
LVL 11

Assisted Solution

by:mohammadzahid
mohammadzahid earned 200 total points
ID: 16899937
try adding TNS_ADMIN in your environment and point that variable to directory where tnsnames.ora file is located.

Example:  TNS_ADMIN    C:\oracle\ora92\network\admin\tnsnames.ora

0
 
LVL 10

Author Comment

by:orbulat
ID: 16900714
I've de-installed and reinstalled again

the problem is finally solved...

thanks for everyone's effort!
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Note: this article covers simple compression. Oracle introduced in version 11g release 2 a new feature called Advanced Compression which is not covered here. General principle of Oracle compression Oracle compression is a way of reducing the d…
This post first appeared at Oracleinaction  (http://oracleinaction.com/undo-and-redo-in-oracle/)by Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
This video shows how to copy a database user from one database to another user DBMS_METADATA.  It also shows how to copy a user's permissions and discusses password hash differences between Oracle 10g and 11g.
This video shows information on the Oracle Data Dictionary, starting with the Oracle documentation, explaining the different types of Data Dictionary views available by group and permissions as well as giving examples on how to retrieve data from th…
Suggested Courses

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question