Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is ODP.NET required for Oracle 11g Client?

Tags:

oracle

odp.net

I may be asking the wrong question here, I'm willing to change it if so.

I have a project that is using the Microsoft.NET Oracle provider (our plan is to change to ODP but we haven't done so yet).

I am trying to get this project to build on a windows 2008 (x64) build server. It builds just fine but our unit tests fail when they hit stuff on the Oracle database.

I had initially installed the 32bit oracle 9i client which is what we currently use on our winxp dev boxes and the previous 2003 build server. But now this gets a message like: Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.

We tried compiling to the x86 platform but that didn't change the error message.

I now have the 11g 64 bit client installed but I am getting a message saying System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.

So what Oracle install should I be using?

Edit:

I was able to get this to work. Turned out it was the testing causing the problem, by forcing NUnit to run in 32bit mode: http://geekswithblogs.net/Lance/archive/2006/12/28/102191.aspx I was able to get the tests to work using the old 32 bit driver. This would be a crappy answer to the question so I am not using it but will gladly award the correct answer to anyone putting in some good info on transitioning to Oracle 64bit drivers.

like image 680
Jeff Martin Avatar asked Jul 21 '09 16:07

Jeff Martin


People also ask

Does ODP NET require Oracle client?

Managed ODP.NET does not require any Oracle Client installation. The final step is to configure the database server connection, which is specific to your application environment.

What is ODP NET Oracle?

Oracle Data Provider for . NET (ODP.NET) features optimized ADO.NET data access to the Oracle database. ODP.NET allows developers to take advantage of advanced Oracle database functionality, including Real Application Clusters, self-tuning statement cache, Application Continuity, and Fast Connection Failover.

Does Oracle client contain ODAC?

net people, 'Oracle Client' means OUI-installed ODAC Instant Client + . Net drivers, possibly also ODT.

What is Oracle 11g client used for?

Oracle Instant Client enables development and deployment of applications that connect to Oracle Database, either on-premise or in the Cloud. The Instant Client libraries provide the necessary network connectivity and advanced data features to make full use of Oracle Database.


2 Answers

When it comes to Oracle, I like to use Oracle Instant Client :

  • You don't have to install anything on the target machines (including dev boxes !).
  • You can make sure that your application will run with the specific client you picked.
  • You could even easily have multiple applications work with different client versions on the same computer.
  • As a downside, it adds a significant weight to your application (~19Mb minimum).

Check What is the minimum client footprint required to connect C# to an Oracle database? for more information. To know how to set up a Visual Studio project that will work on x86 as well as x64 machines, check my blog post Oracle Instant Client in Visual Studio.

like image 144
Mac Avatar answered Sep 28 '22 09:09

Mac


I'm adding a new answer since as of this fall (2012) the ODP Managed Code Beta is available. See this link for more information. It is for us highly stable and we are using it in production, mainly because of these reasons:

  • No installation (except for entity framework where a simple registration is needed)
  • It is smaller than the unmanaged version, the footprint is approx 6 MB.
  • It is NOT "bit sensitive", ie Any CPU will finally work with ODP :)
  • More intuitive mapping C# types <-> Oracle types (and it solved some problems with EF and model generation from database)
  • Supports EZCONNECT (all versions of the unmanaged ODP did not), ie no more tnsnames.ora hassles.

But for transitioning to 64 bit, download the managed ODP driver and change the Oracle.DataAccess reference to Oracle.ManagedDataAccess and recompile :)

like image 23
flindeberg Avatar answered Sep 28 '22 09:09

flindeberg