Solved

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

Posted on 2004-04-30
11
11,623 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
  • 4
  • 2
  • 2
  • +3
11 Comments
 
LVL 21

Accepted Solution

by:
tovvenki earned 333 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 167 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
NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

 
LVL 21

Assisted Solution

by:tovvenki
tovvenki earned 333 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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
Creating an analog clock UserControl seems fairly straight forward.  It is, after all, essentially just a circle with several lines in it!  Two common approaches for rendering an analog clock typically involve either manually calculating points with…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

773 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