Solved

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

Posted on 2004-04-30
11
11,602 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
 
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
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Zoom web page in asp.net 2 37
VB.Net - For Loop Error 5 26
Showdialog 8 21
Unable  to create new object 9 28
Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

760 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now