Problem with .Net ODAC 11g  -- >> ora-12514: TNS: listener does not currently know of service requested in connect descriptor

Posted on 2012-09-12
Last Modified: 2012-09-13

We've got a 32 bit .Net windows application which uses ODAC 10g (1.x) to connect to a 10g database on the backend.
Things work fine in this deployment.

We're in the process of setting up a new development machine.
This machine has ORACLE 11g (64 bit) installed on it.
We're running into issues connecting the the database.

This is the code block we're using to connect to the database:
string dataString = "user id=xxx;password=\"xxx\";data source=localhost:1521/ORCL";
using (OracleConnection oraconn = new OracleConnection(dataConn))

Oracle.DataAccess.Client.OracleCommand cmd = new OracleCommand(sOraSQL, oraconn);
cmd.CommandType = CommandType.Text;
Oracle.DataAccess.Client.OracleDataAdapter da = new OracleDataAdapter(cmd);

DataTable dt = new DataTable();

return dt;

We get an exception on the "oraconn.Open()" command.
ora-12514: TNS: listener does not currently know of service requested in connect descriptor

Here is what the TNSNAMES.ORA file looks like:
# tnsnames.ora Network Configuration File: C:\app\DjM\product\11.2.0\dbhome_1\network\admin\tnsnames.ora
# Generated by Oracle configuration tools.

  (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

      (SID = CLRExtProc)

    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
      (SERVICE_NAME = orcl.168.1.100)

This is what the SQLNET.ORA file looks like:

# 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.


This is what the connection string looks like:
"user id=xxx;password=\"xxx\";data source=localhost:1521/ORCL"

We are able to run SQLDeveloper and point to the same SID (ORCL) and we can connect to the DB instance fine.

We were also able to install 11g 32 bit ODAC on the original machine and it worked fine there.

This has got to be something config related with tnsnames or something along those lines.

Any and all help/suggestions would be appreciated there.

Question by:jxbma
    LVL 20

    Expert Comment

    by:Amitkumar Panchal
    What is the SID on your oracle server..

    ORCL =
        (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
        (CONNECT_DATA =
          (SERVER = DEDICATED)
          [b](SERVICE_NAME = orcl.168.1.100)[/b]

    Open in new window

    You need to provide the SID with the SERVICE_NAME. Check that SID is created with "orcl.168.1.100" name, as sometime oracle truncate some characters from the SID.
    LVL 76

    Accepted Solution

    "We've got a 32 bit .Net windows application"
    "This machine has ORACLE 11g (64 bit) installed on it."

    The Bit versions need to match.  The 32Bit compiled app cannot reference 64Bit DLLs.

    You will also need the exact ODAC version used to compile the app or you will run into version issues.

    There might be an app.config tweak you can do for the version but I've never used it.

    It is discussed here:

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to improve team productivity

    Quip adds documents, spreadsheets, and tasklists to your Slack experience
    - Elevate ideas to Quip docs
    - Share Quip docs in Slack
    - Get notified of changes to your docs
    - Available on iOS/Android/Desktop/Web
    - Online/Offline

    I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
    This post first appeared at Oracleinaction  ( Anju Garg (Myself). I  will demonstrate that undo for DML’s is stored both in undo tablespace and online redo logs. Then, we will analyze the reaso…
    This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
    This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    10 Experts available now in Live!

    Get 1:1 Help Now