?
Solved

ORA-12154: TNS:could not resolve service name

Posted on 2006-06-13
14
Medium Priority
?
2,527 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
Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

 
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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

How to Create User-Defined Aggregates in Oracle Before we begin creating these things, what are user-defined aggregates?  They are a feature introduced in Oracle 9i that allows a developer to create his or her own functions like "SUM", "AVG", and…
Configuring and using Oracle Database Gateway for ODBC Introduction First, a brief summary of what a Database Gateway is.  A Gateway is a set of driver agents and configurations that allow an Oracle database to communicate with other platforms…
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

650 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