Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1766
  • Last Modified:

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

Hi:

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))
{
oraconn.Open();

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();
da.Fill(dt);

oraconn.Close();
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.

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


ORACLR_CONNECTION_DATA =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1521))
    )
    (CONNECT_DATA =
      (SID = CLRExtProc)
      (PRESENTATION = RO)
    )
  )

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (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.

SQLNET.AUTHENTICATION_SERVICES = (NTS)

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


NOTE::
======
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.

Thanks,
JohnB
0
jxbma
Asked:
jxbma
1 Solution
 
Amitkumar PSr. ConsultantCommented:
What is the SID on your oracle server..

ORCL =
  (DESCRIPTION =
    (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.
0
 
slightwv (䄆 Netminder) Commented:
"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:
http://www.experts-exchange.com/Database/Oracle/Q_27020817.html#a35709210
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now