Exception has been thrown by the target of an invocation. ORA-12504: TNS:listener was not given the SERVICE_NAME in CONNECT_DATA

Hello,

V8.1.4

Oracle database is my target system in our client environment. I integrated using Native database connector as a custom target system and have created script and process for provisioning and it has no errors when compiled. When I tried to run the script in test script initially I got

"Exception has been thrown by the target of an invocation.
Cannot obtain Oracle Client information from registry. Make sure that Oracle Client Software is installed and that the bitness of your application (x64) matches the bitness of your Oracle Client, or use the Direct mode of connecting to a server."

and after installing the exact client version the error was resolved and now I started facing the below error.

Any suggestions please ?

 

Thanks,

  • Hi pavithra,

    please ensure your local configuration in file "tnsnames.ora" (usually stored in folder %ORACLE_HOME%\network\admin) has an entry for Oracle database you are trying to connect. Example, please replace the items in <> with your settings:

    <servername> =
      (DESCRIPTION =
        (ADDRESS_LIST =
          (ADDRESS = (PROTOCOL = TCP)(HOST = <ipaddress>)(PORT = 1521))
        )
        (CONNECT_DATA =
          (SERVICE_NAME = <tnsservicename>)    
          (SID = <dbsid>)
          (SERVER = DEDICATED)
        )
      )

    Regards,

      Tino

  • Hi Tino,

    Thanks for your response. I just wanted to add more points here. I have installed oracle client v11.2.0.4.0(instantclient-basic-windows.x64-11.2.0.4.0) and odbc (instantclient-odbc-windows.x64-11.2.0.4.0). In odbc data source, created user DSN & system DSN and test connection is successful. I cannot find tnsnames.ora file or listener.ora file and there is no oracle folder/path in these installers. Also I downloaded managedAccessData.dll (ODP.NET_Managed_ODAC122cR1) zip file, in this folder I can see tnsnames.ora file and here I have specified all the details in the below format and also changed the format as you have mentioned above but even though I face the same error while I run the script.

    ServiceName =
      (DESCRIPTION =
        (ADDRESS = (PROTOCOL = TCP)(HOST = IP/ServiceName)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          (SERVICE_NAME = ServiceName)
        )
      )

    Please let me know if I'm missing anything here.

    Thanks,