Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

"ORA - 12154 TNS: Could not resolve service name" using Microsoft's "system.data.oracleclient.dll" assembly

Posted on 2004-04-30
11
Medium Priority
?
11,667 Views
Last Modified: 2012-06-27
Hello,

I'm writting an applicatin in VB.NET that connects to an Oracle Database. I'm using Microsofts Orcale Client provider (system.data.OracleClient.dll). Everything is working fine on my computer (lol), but on a test computer, I am getting the error: "ORA - 12154 TNS: Could not resolve service name". I have a tnsnames.ora file and all other oracle applications are working fine. I also created an environment variable named TNS_ADMIN and pointed it to where the tnsnames.ora file is located. There are no errors within the tns file. Other oracle applications are using the tns file just fine and the tns names and definitions are valid (have been verified).

One point of note: on my machine, I have client software for oracle 9 but on the test computer it is 8.1

Both computers are using the DotNet framework 1.1
Both computers have system.data.oracleclient.dll
the TNS files are in different locations on both machines (theoretically, they could be anywhere)

It seems like microsofts provider cannot find the tnsnames.ora file. I'm not sure what to do to make sure it is finding the correct file.

I need help resolving this problem. Any assistance is much appreciated.

Thanks,
Tony
0
Comment
Question by:mytonytiger
[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
  • 4
  • 2
  • 2
  • +3
11 Comments
 
LVL 21

Accepted Solution

by:
tovvenki earned 999 total points
ID: 10961738
Hi,
I think you need oracle client software to be installed in the test server also If you're using ASP.NET, you must also ensure that the appropriate "Web server users" (usually the user named ASPNET who runs the ASP.NET worker process) can access the client. Because ASPNET has only ordinary user privileges and not administrator privileges, you need to add ASPNET to the Access Control List. If the ASPNET user doesn't have access, you'll receive a message such as "Cannot load OCI.dll" or "ORA-12154 TNS: could not resolve service name."
have a look at this url
http://www.fawcette.com/vsm/2003_01/magazine/features/beauchemin/default_pf.aspx

hope that this helps you.

regards,
venki
0
 
LVL 5

Author Comment

by:mytonytiger
ID: 10961850
Oracle client software is on the test box, but I don't think it is necessary since I'm using Microsofts provider for Oracle. Also, I'm writing a windows application, not ASP, so I don't see the connection with setting up an ASPNET account. I'll take a look at the link though and see.

Thanks for the input. Also, I'm not saying your wrong, just that I don't think that is the solution.

0
 
LVL 5

Assisted Solution

by:tgannetts
tgannetts earned 501 total points
ID: 10966558
I think the tnsnames.ora files do have to be in the correct folder (the Network\Admin folder of the Oracle home directory)
To use local naming with Oracle 8.1, you need the tnsnames.ora to be in the C:\oracle\ora81\network\ADMIN\ directory.

BTW Can you connect to the database using SQLPlus on the test machine?

Tom
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 21

Assisted Solution

by:tovvenki
tovvenki earned 999 total points
ID: 10974688
Hi,
a. in the test machine are you able to connect to the oracle database using the oracle client.
I think the problem might be with the Net Service Name that you are using. So using the Oracle Client configure the net Service and make a connection with the Oracle Server by making a Service, using Oracle Net Configuration Assistant. Be sure to Test this service through the Assistant.
b. are you using the same sid in both the machines.

regards,
venki
0
 
LVL 5

Author Comment

by:mytonytiger
ID: 10990236
I cannot connect to the database at all.

The tnsnames.ora is in C:\oracle\ora81\network\ADMIN\

0
 
LVL 5

Author Comment

by:mytonytiger
ID: 11030645
In 8 days, no one has an answer?

The suggestions above do not answer my question. Things suggested (such as client software and tnsnames) were already in place before I asked, and others (such as web server users) do not apply.

After waiting over a week for an answer (first time ever for me on Experts-exchange I didn't get an answer that helped), I've given up

It's a shame too.

0
 
LVL 5

Expert Comment

by:tgannetts
ID: 11030719
I'm afraid that this problem does not appear to be a VB.Net problem - if you cannot connect to the database through SQL Plus then I suggest asking this question in one of the Oracle TAs.

Sorry couldn't be of any help....

Tom.
0
 
LVL 5

Author Comment

by:mytonytiger
ID: 11052738
Tom,

I never said I couldn't connect with SQL Plus.

When I said I couldn't connect to the database at all, I was referring to my application. I had misread tovvenki's question and answered according to what I thought he was asking. Since I had already stated in the first post "other oracle applications are working fine" I just figured it was clear. Sorry for the confusion. I didn't even catch my mistake until you just now pointed it out. But since there was no feedback, I missed it.

I really don't care if this is a .NET issue, an Oracle Issue, or what anymore. I just need it fixed and can't figure out why it won't work.

I guess I'll just rebuild and start over.
0
 

Expert Comment

by:sergey_qw
ID: 11158928
By the way what exactly version of 8.1 Oracle client on test machine?

.Net Microsoft oracle provider supports Oracle client software version 8.1.7 and later
0
 

Expert Comment

by:madhukartha
ID: 11368073
By any chance, did you manage to resolve this problem?
We are facing the same problem.When searched , we got a link to this posting.
0
 

Expert Comment

by:hparab
ID: 11815472
Did any find a solution to this? Again a windows app, and can connect with SQL plus. but get the error msg while trying from the app. TNSnames.ora is in the correct place also
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

722 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