locked
Oracle ORA-12154 TNS Could Not Resolve Service Name RRS feed

  • Question

  • User-691759321 posted

    I have an application that works great locally.  When we moved it to our test server (running Windows 2003, .NET 3.5, Oracle 9i Client 9.2.0.7.0) it returns the stack trace below.  I have used TNSPING to test the connection string and it is working fine.  I can connect to the database using TOAD for Oracle Freeware version.  Oracle 9i Client is the only version of the Oracle software installed.  I have tried restarting the server.  Any one able to provide some possible solutions?

    Unknown Error

    System.Data.OracleClient.OracleException: ORA-12154: TNS:could not resolve service name

    at System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc)

    at System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName)

    at System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions)

    at System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)

    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

    at System.Data.OracleClient.OracleConnection.Open()

    at Microsoft.Practices.EnterpriseLibrary.Data.Database.GetNewOpenConnection() in C:\TrialBase\Baseline\ThirdParty\EnterpriseLibrary\Microsoft.Practices.EnterpriseLibrary.Data\Database.cs:line 1163

    at Microsoft.Practices.EnterpriseLibrary.Data.Database.GetOpenConnection(Boolean disposeInnerConnection) in C:\TrialBase\Baseline\ThirdParty\EnterpriseLibrary\Microsoft.Practices.EnterpriseLibrary.Data\Database.cs:line 1196

    at Microsoft.Practices.EnterpriseLibrary.Data.Database.GetOpenConnection() in C:\TrialBase\Baseline\ThirdParty\EnterpriseLibrary\Microsoft.Practices.EnterpriseLibrary.Data\Database.cs:line 1177

    at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command) in C:\TrialBase\Baseline\ThirdParty\EnterpriseLibrary\Microsoft.Practices.EnterpriseLibrary.Data\Database.cs:line 973

    Thursday, November 19, 2009 12:15 PM

Answers

  • User-691759321 posted

    Solution found:

    Oracle drivers for 9.2.0.7.0 (and possibly others) do not like it when the application path contains "(" or ")".  Once we renamed the directory where the executables were located the application ran smoothly.  This is a very poor bug that should never happen.  Shame on Oracle. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 30, 2009 2:15 PM

All replies

  • User656402446 posted

    please refer

    http://forums.asp.net/p/1054934/1498691.aspx#1498691

    http://ora-12154.ora-code.com/

    Thursday, November 19, 2009 4:21 PM
  • User-691759321 posted

    The first link assumes I have 10g installed and I do not.  The second link showed me one or two minor issues with the sqlnames.ora file but none of the fixes caused the application to work.  I am still at a stand still.  SQL*Plus, TOAD for Oracle, TNSPING, and regular ping on the database server address are all working.   Just the application is failing.  The old version of the application is even running.

    Heres another topper.  I installed VB.Net Express on the same machine copied the source code over and ran the code in debug and it ran perfectly fine.  I took the same output from the bin directory and copied it to the folder where i have the executables for testing and it doesn't work.  Could there be some weird path issue or dependency that is missing when it deploys the project?

    Thursday, November 19, 2009 4:35 PM
  • User364663285 posted

     

    I have an application that works great locally.  When we moved it to our test server (running Windows 2003, .NET 3.5, Oracle 9i Client 9.2.0.7.0) it returns the stack trace below.  I have used TNSPING to test the connection string and it is working fine.  I can connect to the database using TOAD for Oracle Freeware version.  Oracle 9i Client is the only version of the Oracle software installed.  I have tried restarting the server.  Any one able to provide some possible solutions?

    Unknown Error

    System.Data.OracleClient.OracleException: ORA-12154: TNS:could not resolve service name

    at System.Data.OracleClient.OracleException.Check(OciErrorHandle errorHandle, Int32 rc)

    at System.Data.OracleClient.OracleInternalConnection.OpenOnLocalTransaction(String userName, String password, String serverName, Boolean integratedSecurity, Boolean unicode, Boolean omitOracleConnectionName)

    at System.Data.OracleClient.OracleInternalConnection..ctor(OracleConnectionString connectionOptions)

    at System.Data.OracleClient.OracleConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options)

    at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject)

    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)

    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)

    at System.Data.OracleClient.OracleConnection.Open()

    at Microsoft.Practices.EnterpriseLibrary.Data.Database.GetNewOpenConnection() in C:\TrialBase\Baseline\ThirdParty\EnterpriseLibrary\Microsoft.Practices.EnterpriseLibrary.Data\Database.cs:line 1163

    at Microsoft.Practices.EnterpriseLibrary.Data.Database.GetOpenConnection(Boolean disposeInnerConnection) in C:\TrialBase\Baseline\ThirdParty\EnterpriseLibrary\Microsoft.Practices.EnterpriseLibrary.Data\Database.cs:line 1196

    at Microsoft.Practices.EnterpriseLibrary.Data.Database.GetOpenConnection() in C:\TrialBase\Baseline\ThirdParty\EnterpriseLibrary\Microsoft.Practices.EnterpriseLibrary.Data\Database.cs:line 1177

    at Microsoft.Practices.EnterpriseLibrary.Data.Database.ExecuteScalar(DbCommand command) in C:\TrialBase\Baseline\ThirdParty\EnterpriseLibrary\Microsoft.Practices.EnterpriseLibrary.Data\Database.cs:line 973

     

    Make sure that you have .NET framework on the server

    Wednesday, November 25, 2009 11:08 PM
  • User-691759321 posted

    Solution found:

    Oracle drivers for 9.2.0.7.0 (and possibly others) do not like it when the application path contains "(" or ")".  Once we renamed the directory where the executables were located the application ran smoothly.  This is a very poor bug that should never happen.  Shame on Oracle. 

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, November 30, 2009 2:15 PM
  • User1809005601 posted

    Thanks , it resolved my issue .

    Wednesday, July 13, 2011 1:09 AM