locked
Ora-12154 TNS:could not resolve the connect identifier specified using oracle.dataaccess.dll RRS feed

  • Question

  • User369345748 posted

    I have a local console app that connects to an Oracle 11 database to execute a simple Select * from View query.  It runs fine in localhost, with any of the following connection strings 

    (FYI the host isn't really 1.2.3.4 :)  ) 

    value="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=1.2.3.4)(PORT=1601))(CONNECT_DATA=(SERVICE_NAME=UAT1)))"

    value="1.2.3.4:1601/UAT1" 

    value="myTNSentry" 

    This value is used in as follows

    OracleConnection conn = new OracleConnection();
    conn.ConnectionString = "User Id=myUserId;Password=myUserPassword;Data Source="+ value+ ";";
    conn.Open();

    When I publish this to a server & run the setup.exe, conn.Open(); fails with the Ora-12154 error.

    Any suggestions gratefully received

    Thursday, October 27, 2016 12:16 PM

All replies

  • User753101303 posted

    Hi,

    Not using Oracle but try perhaps https://docs.oracle.com/cd/B19306_01/server.102/b14219/net12150.htmand and scroll down to this error which shows a number of things to check. The same Oracle client is configured the same way on the web server?

    As it seems to be really quite a specialized Oracle client configuration issue I would rather try a specialized Oracle forum for this one rather than a general "using Oracle & other dbms from ASP.NET" forum.

    Thursday, October 27, 2016 8:02 PM
  • User269602965 posted

    Oracle 12154 is a common error when moving application from one location to another.  It is a generic error which means it can have many causes.

    Common causes

    1. Incorrect TNS information supplied to database server listening for connections.

    2. Firewalls, both hardware and software blocking the listening port.

    3. Failure to install Oracle Client on the application server if using UNMANAGED ODP.net Oracle Data Access, or if using the MANAGED ODP.NET Oracle Data Access driver, improper configuration of the driver setup and pointers to the correct tnsnames.ora file.

    providing more information on your production environment would help readers here provide help.

    Friday, October 28, 2016 3:11 AM
  • User369345748 posted

    Thanks both.

    I am inclined to think that the remote server is configured correctly, as is the TNS data.  Because the process works when I run t on my local host.  

    But firewalls are  an interesting thought

    Friday, October 28, 2016 9:25 AM
  • User753101303 posted

    I would not phaseout a configuration problem that soon. Keep in mind that this stuff relies on the *local* Oracle client configuration so if it is not configured the same way it is expected to not work. I would compare the Oracle configuration files on both machines... Also it might try to search for configuration files at some other location?

    Friday, October 28, 2016 10:47 AM
  • User269602965 posted

    The database server might be configured correctly but I am not so sure you application server calling the database is configured correctly, and/or your application.

    When you leave development box... local host means nothing any more... you are in a new world and the connection strings, Oracle client, etc. must all be set up for the new environment.

    And yes, firewalls blocking listening port is a very common issue.

    Friday, October 28, 2016 10:31 PM