Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does ODP.NET require Oracle Client installation

I have to connect Oracle 11g DB from .NET code. For that purpose I installed ODP.NET bur after reading some forum posts I recognized that I need Oracle Client installation too.

Is that true? I see that the Oracle Client has a size of ca. 2GB!!! Do I really need to install such a huge client only to be able to connect Oracle DBs?

like image 931
llasarov Avatar asked Oct 19 '11 10:10

llasarov


People also ask

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.

Where is ODP NET installed?

Upon installation of ODP.NET, Oracle Universal Installer sets the DllPath Windows Registry value to the ORACLE_BASE\\ORACLE_HOME \bin directory where the corresponding dependent DLLs are installed. Developers must provide this configuration information on an application-by-application basis.

Is ODAC same as Oracle client?

Answer: ODAC isn't a product. Instead, ODAC is a collection of drivers that provide Oracle client connectivity to Oracle. If you are asked by the Oracle installer software to install a particular Oracle driver, (ODBC, OLE DB or a provider for . NET) then you just need to install whole the ODAC package.

Does Oracle need client?

Oracle recommends using an Oracle Client version that matches the highest Oracle database version that you need to connect to. Using older clients to connect to newer database versions can cause issues (one of which is that older clients will not understand newer datatypes such as timestamps.)


2 Answers

Alex Keh from Oracle in aug 2013 says:

Managed ODP.NET is released. It is currently part of the Oracle DB 12c client. To use managed ODP.NET, you have to download and install the DB client. From there, you can extract just the managed ODP.NET assembly and setup files. These files are less than 10 MB and can be deployed to any target machines.

Currently, we are packaging a stand alone managed ODP.NET release and ODAC 12 release that will be much smaller. This will be released on OTN shortly.

If you can wait a couple of days, ODAC 12c will be out on OTN and you can download that version. That will be our latest and greatest managed ODP.NET version

====

We do not plan to put managed ODP.NET on NuGet. We believe that the managed ODP.NET download with ODAC will provide the same benefits of NuGet in terms of assembly isolation and download size.

There's a thread discussing whether Oracle should provide managed ODP.NET NuGet support. Once you use ODAC 12c, I would like to know your thoughts on whether NuGet support is still necessary. https://forums.oracle.com/thread/2559445

Nuget managed ODP.NET:

PM> Install-Package Oracle.ManagedDataAccess 

So what is the problem anyway?
Basically up until now, ODP.NET was a .NET layer that talks to the Oracle client .dll files, a small fact that had many implications:

  • Large installation footprint (several hundreds of Mb)
  • Tough deployment to remote machines - needs to install ODP.NET on client machine or deploy large files
  • Challenging when working with several versions, 32bit/64bit os and applications

So what is it?

The managed driver is basically a single .dll file with a .Net native implementation of ODP.NET.
That means no Oracle Client is needed, and now native code is behind the scenes. XCopy installation can be done easily.

Major benefits:

  • Small footprint
  • Compiled as any cpu so it can work on 32bit/64bit OS and application smoothly. Easy to manage multiple versions on the same machine
  • Can be deployed as a simple reference in the application bin directory.

So what's the catch?

  • Not all features are supported (although most of them are... ) you can find out more on the documentation
  • Namespace is changed from Oracle.DataAccess.Client to Oracle.ManagedDataAccess.Client
  • Performance differences are still not clear. (The old) Native code always perform very efficiently, but on the other hand 100% managed code has it's performance benefits.

Please note that the Native-Code ODP.NET is still very much available. The managed version (at least for now) comes in addition to the native one.

References: http://oracleatdotnet.blogspot.com.es/2013/07/odpnet-managed-driver-beta-2.html

Differences between the ODP.NET Managed Driver and Unmanaged Driver http://docs.oracle.com/html/E41125_02/intro004.htm

Features of Oracle Data Provider for .NET http://docs.oracle.com/database/121/ODPNT/features.htm#ODPNT0007

like image 85
Kiquenet Avatar answered Sep 18 '22 21:09

Kiquenet


you can get managed ODP.NET using NuGet too https://www.nuget.org/packages/odp.net.managed/

PM> Install-Package odp.net.managed  

Watch the quick start video on using ODP.NET Managed Driver! (copied from http://www.oracle.com/technetwork/topics/dotnet/whatsnew/index.html)

http://www.youtube.com/watch?feature=player_embedded&v=I1q50HnUh_w


Update:

NuGet for Official Oracle ODP.NET, Managed Driver https://www.nuget.org/packages/Oracle.ManagedDataAccess/

Or Package Manager Console

PM> Install-Package Oracle.ManagedDataAccess 
like image 34
Riju Avatar answered Sep 21 '22 21:09

Riju