none
ORA-12154: TNS:could not resolve the connect identifier specified.

    Question

  • We are facing very different problem.
    Following is the environment that is established
    Windows Server 2008 R2
    Visual Studio 2010
    SQL Server 2008
    BizTalk Server 2010
    Oralce 10g client (Installation type : administrator)
    TOAD 9
    PLSQL Developer 7.1
    We are planning to migrate on BizTalk Server 2010 from BizTalk Server 2006 R2. For this purpose we create above environment. 
    After the creation of this environment we start to deploy our services. These services had been created in BizTalk Server 2006 R2 and we just export MSI, binding, DLL, BRE, IIS , SSO and start to import all these things in BizTalk 2010. 
    We have faced several issue in start mostly related to IIS. But with the course of time, one after another we have figure out to solve problem. But we have now stuck on the following error 
    ORA-12154: TNS:could not resolve the connect identifier specified.
    Problem is that we have check all related thing, We have only single home. Ora TNS file is placed at correct location.
    We reinstall Oracle client, TOAD and PLSQL Developer but no use.
    Now we think about to recompile projects and redeploy. We take a single service as an example, compile and redeploy it.
    Here we find some different behavior. We have a .Net helper that is class library. We connect TNS in that class library. We are using Oralce.DataAccess assembly.
    We do this by create windows application and add reference of our .Net helper and execute function in .Net helper to connect TNS. It work fine. But same .Net helper is GACed in GAC then it through above error. It is strange.
    We also deployed and configure ODAC112021Xcopy_x64 on our server successfully according to log files.
    Concluded is that
    - We are able to connect to Oracle with PLSQL Developer.
    - We are able to connect to Oracle with TOAD.
    - We are not able to connect with Our .Net Helper when it is GACed.
    - We are able to connect when we add .Net Helper in a .Net Client and Call function to connect to Oracle.
    -       When our service hit with same TNS above mention error occurred.
    Kindly suggest the solution.

    Muhammad Faiq Bakhtyar Software Engineer(Avanza Solutions) MOSS Consultant (Next Tech.)
    Wednesday, April 20, 2011 10:48 AM

Answers

  • Well, let me share a secret with you. I was also facing similar problem. I exposed my data access layer as normal WCF service and inside web.config placed the connection string as follows:

    connectionString

     

    ="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sonamoni)(PORT=1521))(CONNECT_DATA=(SERVER=dedicated)(SID=devKummu)));User Id=ambar;Password=@Puchu123;

    "

     

     

    name="DEVSRVR

    "

     

     

    providerName="Oracle.DataAccess.Client"/>

    This makes the tnsnames.ora file and/or its location redundant. Also not only now I can call my wcf service from BizTalk, but also from other .NET apps.

    Please don't hack my system :) 

     
    Please mark as answer if this helps you. Thanks and warm regards Ambar Ray Solution Architect - Microsoft Technologies
    Thursday, April 21, 2011 10:53 AM

All replies

  • Did you check into GAC if the correct version is being installed which you are referring to? May be trying resolving the connection issue with simple .net application might help? Also you can paste the full error that you got while doing so. 
    Please mark it as Answer if this answers your question
    Thanks.
    Mo
    The contents I write here is my personal views, not the view of my employer and anyone else.
    Wednesday, April 20, 2011 2:45 PM
  • Did you check if the service name you are using in Biztalk matches what is in tnsnames.ora?
    SRG
    Wednesday, April 20, 2011 5:57 PM
  • When you place your dll in GAC it searches for the connection string information in .dll.config which it does not get obviously inside GAC. Hence the problem. When you call the class library from windows application, it searches for the connection string information in .exe.config in local bin which it gets. Hence no problem.

    Now, the solution for you is that you need to expose your data access layer methods using a WCF service and place the connection string information inside the web.config


    Please mark as answer if this helps you. Thanks and warm regards Ambar Ray Solution Architect - Microsoft Technologies
    Thursday, April 21, 2011 3:22 AM
  • Yes I did, the connection which i use in my service is mention in tnsnames.ora
    Muhammad Faiq Bakhtyar System Architect | IT Group Transformation & Enterprise Architecture | United Bank Limited
    Thursday, April 21, 2011 9:20 AM
  • Dear Ambar, 

    We pick connection string from BRE. 


    Muhammad Faiq Bakhtyar System Architect | IT Group Transformation & Enterprise Architecture | United Bank Limited
    Thursday, April 21, 2011 9:59 AM
  • Well, let me share a secret with you. I was also facing similar problem. I exposed my data access layer as normal WCF service and inside web.config placed the connection string as follows:

    connectionString

     

    ="Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=sonamoni)(PORT=1521))(CONNECT_DATA=(SERVER=dedicated)(SID=devKummu)));User Id=ambar;Password=@Puchu123;

    "

     

     

    name="DEVSRVR

    "

     

     

    providerName="Oracle.DataAccess.Client"/>

    This makes the tnsnames.ora file and/or its location redundant. Also not only now I can call my wcf service from BizTalk, but also from other .NET apps.

    Please don't hack my system :) 

     
    Please mark as answer if this helps you. Thanks and warm regards Ambar Ray Solution Architect - Microsoft Technologies
    Thursday, April 21, 2011 10:53 AM
  • Dear all I have installed 64bit version of Oracle 10g now TNS issue resolve and m facing new one :) 

     

    Error description 

    "Could not load file or assembly 'Oracle.DataAccess, Version=10.2.0.100, Culture=neutral, PublicKeyToken=89b483f429c47342' or one of its dependencies. The system cannot find the file specified."

     

    This file found on 32bit version of Oracle 10g at path "E:\oracle\product\10.2.0\client_1\BIN" while on 64bit this file is missing.

     

    Kindly suggest.

     


    Muhammad Faiq Bakhtyar
    Tuesday, May 10, 2011 4:32 AM
  • Hi Muhammad,

                         For me it works only if I have 32 bit oracle client dll in the assembly. Even though the server is a 64 bit machine, I always had to have the 32-bit client installed. The reason I assume is we use 32-bit at design time and run time needs the same version. Can you try installing both versions(32 and 64 bit) of oracle client?

     I had similar error in the past. I've tried sevral suggestions, but I think the above setup worked finally. Please note that the BTS host must run in 32-bit only mode in case you install 32-bit client and end up using it.

     


    SRG

    • Edited by curious_mind Tuesday, May 10, 2011 4:43 AM more info
    Tuesday, May 10, 2011 4:41 AM
  • Dear SRG,

    Thanks for your information, the scenario is 

    we have 
    Windows Server 2008 R2
    Visual Studio 2010
    SQL Server 2008
    BizTalk Server 2010
    Oralce 10g client (Installation type : administrator) 32 bit
    TOAD 9
    PLSQL Developer 7.1
    Server is a 64bit machine

    When I have 32bit client the error was 

    ORA-12154: TNS:could not resolve the connect identifier specified.

    when i installed 64bit client of oracle 10g with ODAC it shows above error.



    Muhammad Faiq Bakhtyar
    Tuesday, May 10, 2011 5:03 AM
  • Did it ever work with only 32-bit client installed?

    So right now you have both the clients installed, with the "Could not load file or assembly .." error. Is that correct?

    Sorry, last question. Are you using exactly the same client version (DLL with same version)as was used while building the app?


    SRG
    Tuesday, May 10, 2011 12:52 PM
  • Dear Ambar, I also encounter this problem now. To solve problem - ORA-12154: TNS:could not resolve the connect identifier specified. I paste my Oracle config files and Web.config file here, please help me and give me some guidance.

    sqlnet.ora:

    # sqlnet.ora Network Configuration File: D:\oracle\product\10.2.0\client\network\admin\sqlnet.ora
    # Generated by Oracle configuration tools.
    
    # This file is actually generated by netca. But if customers choose to 
    # install "Software Only", this file wont exist and without the native 
    # authentication, they will not be able to connect to the database on NT.
    
    SQLNET.AUTHENTICATION_SERVICES= (NTS)
    
    NAMES.DIRECTORY_PATH= (TNSNAMES)
    

    tnsnames.ora

    # tnsnames.ora Network Configuration File: C:\DACS\DACS_ClientTool\tnsnames.ora
    # Generated by Oracle configuration tools.
    
    OSLO_OSLO =
     (DESCRIPTION =
      (ADDRESS_LIST =
       (ADDRESS = (PROTOCOL = TCP)(HOST = 172.27.199.191)(PORT = 1521))
      )
      (CONNECT_DATA =
       (SID = oslo)
       (SERVER = DEDICATED)
      )
     )

    Web.config

    <?xml version="1.0" encoding="utf-8"?>
    <configuration>
     <appSettings/>
     <connectionStrings/>
     <system.web>
      <webServices>
       <conformanceWarnings>
        <remove name="BasicProfile1_1"/>
       </conformanceWarnings>
    
       <protocols>
        <add name="HttpPost"/>
        <add name="HttpGet"/>
       </protocols>
      </webServices>
      </system.web>
    </configuration>
    
    Can you give me some guidance how to modify my Web.config file. Thank you in advance.  And any other suggestion with setting ASP.NET account would be highly appreciated.
    Bing Yan, E-mail: bing.yan@fujixerox.co.jp Fuji Xerox Solution Developing Centre, Yokohama, Kanagawa, Japan
    Thursday, June 02, 2011 2:35 AM