Paul Stearns
Paul Stearns

Reputation: 906

TNS-12560 error from .NET app on network drive

I have a .NET application that I work on from time to time. I run the IDE (I have tried VB2008, VS2010 and VS2012) on a windows 7 computer.

When I have the solution (project) on my local hard drive it runs in debug mode from the IDE swimmingly. If however I have the solution on a network drive I get TNS-12560.

Spent 2.5 days with Oracle tech support to find out that moving it to my local disk works. They now claim that is the solution.

This is not the solution, I am hoping someone here has the solution.

I am running Oracle 11g r2 (11.2.0.4.0) 32 bit client.

BTW this used to work without any problem. I do not know if MS or Oracle is messing with me.

EDIT - This problem is totally related to the VB.NET solution being on a network drive vs the VB.NET solution being on the local hard drive. If I run the IDE and connect to the solution on the network drive it fails, if I connect to the exact same solution on the local hard disk (C:) it works fine.

Upvotes: 0

Views: 205

Answers (1)

Prescott Chartier
Prescott Chartier

Reputation: 1707

Typically TNS-12560 indicates an error connecting the client to the database listener. Given that it connects on the local machine tells me that the listener on the database you are trying to connect to is up and configured properly to connect to the database. So the issue is on the machine you want to run the software on. You say it has always worked before, so that tells me that the TNS configuration has either been changed or the machine you want to run the software on can no longer reach the database machine on the network. From the machine you want to run the software on, can you ping the database server? If not, then it is unreachable by TNS too and you need to figure out why it's not reachable. If you can ping it, then there is an configuration issue with TNS. On the machine you want to run the software on, use windows explorer to navigate to the TNS configuration folder (Oracle would never tell you to do this, they would tell you to use the TNS configuration tool). The TNS configuration folder is typically found in C:\app\username\product\11.2.0\client_1\network\admin, where username is the user profile that the client was installed under. In there is a file named tnsnames.ora. This file is a simple text file in a specific format that tells the client where on the network the database is. For example, my tnsnames.ora contains:

DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.10.38)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = orcl)
    )
  )

There are three pieces of information that define the connection to the database, the IP address of the machine the database resides on (host = 192.168.10.38), the name of the listener (SERVICE_NAME = orcl) and the port the listener is listening on (PORT = 1521). You will need to confirm that the information is correct for your database.

Upvotes: -1

Related Questions