Solved

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

Posted on 2004-04-30
11
11,615 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

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 …
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

864 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