14

First of all, I want to use the Oracle.DataAccess.dll to use OracleBulkCopy.

I want to know all the dlls that I need to be able to read from a database and then perform a bulkcopy in Oracle. Currently, we are using only one dll to perform all the reads from databases, we are using Oracle.ManagedDataAccess.Client. But I can't use it to perform a bulkCopy.

I don't want to install ODP.NET for the users, I want to include the dll directly in the program. So I want to know the minimum required dlls to be able to use the Oracle.DataAccess.dll in 32bit and in 64bit.

I know that there are some old post about this, but it's quiet old and the listed dlls are out of date. I can't event find some of them.

I installed the ODP.net for ODAC12 and I retreived all the listed dlls in this post. I also tried with with this post. The listed dlls are pointing out the version 11.

I made a dummy project that opens a connection, reads a table and bulk it in another table. I copied the listed dlls from the posts in the root of the project and I included Oracle.DataAccess.dll in the project.

When I run my program in 64 bit I get the following error:

Could not load file or assembly 'Oracle.DataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342'

When I run it in 32 bit, I get this error:

Unable to load DLL 'OraOps12.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)"

The dlls that I included are:

  • oci.dll
  • ociw32.dll
  • Oracle.DataAccess.dll
  • orannzsbb12.dll
  • oraocci12.dll
  • oraociei12.dll
  • OraOps12.dll
Community
  • 1
  • 1
billybob
  • 2,859
  • 6
  • 35
  • 55
  • Are you willing to pay money for a third party connector? In other words, is this work for your employer who would be willing to shell out a few hundred bucks for some software, if you needed it? – Hambone Nov 03 '15 at 21:57
  • What's the name of the third party connector? – billybob Nov 03 '15 at 22:02
  • 2
    Instead of trying to do this dll by dll which is fraught with problems, have a look at the "XCOPY" install. It is smaller and you can embed it into your own installation. http://www.oracle.com/technetwork/topics/dotnet/downloads/index.html – Christian Shay Nov 03 '15 at 22:20
  • I've been using dotConnect for Oracle by DevArt since around 2009. It does cost money, but it eliminates the dependencies for a local Oracle client (like Managed ODP) and still supports advanced OCI features like bulk inserts and updates. And of course, it's all managed DLLs that can be GACed or localized. – Hambone Nov 04 '15 at 01:47

3 Answers3

19

I managed to make it work.

  • Download the good version of the ODAC that will target your project.
  1. For a 32bit project you need to download the ODAC12..._x32.zip (ODAC121021Xcopy_32bit.zip).

  2. For the 64bit project you need to download the ODAC12..._x64.zip

  • Unzip it in an empty folder depending on the version you want (32bit vs 64bit).

  • Locate in the instantclient_12_1 folder all the dlls by searching *.dll in the windows search bar. You need to grab:

  1. oci.dll

  2. ociw32.dll

  3. orannzsbb12.dll

  4. oraociei12.dll

  5. oraons.dll

  • Locate in the odp.net4 or odp.net20 folder depending on your .NET version this two dlls:
  1. OraOps12.dll

  2. Oracle.DataAccess.dll

  • Copy the those 32bit dlls or 64bit dlls and put them directly in the Output path of your project. For example in C:\...\vsProjects\BulkInsert\BulkInsert\bin\Debug.

  • Browse Oracle.DataAccess.dll in your project by pointing on the Output path.

Solution Explorer Screenshot

UPD: recent versions of the ODP.NET provider (downloaded from here) have "19" suffix instead of "12" in their filenames:

  1. oci.dll

  2. ociw32.dll

  3. orannzsbb19.dll

  4. oraociei19.dll

  5. oraons.dll

  6. OraOps19.dll

  7. Oracle.DataAccess.dll

yallie
  • 2,200
  • 1
  • 28
  • 26
billybob
  • 2,859
  • 6
  • 35
  • 55
  • I think it would be better to copy **all** files from folder `instantclient_12_1` (which is equal to install the Oracle Instance Client). I may work you your environment but on slightly different condition it may fail. – Wernfried Domscheit Nov 05 '15 at 07:16
  • Watch you don't copy DLLs from the wrong version of bitness of Oracle. I did and got this error until I got all the DLLs from the same version of Oracle Instant Client: https://stackoverflow.com/questions/38589549/system-typeinitializationexception-the-type-initializer-for-oracle-dataaccess – Matthew Feb 13 '20 at 00:13
1

I experienced similar problem; install oracle data access components (odac ODTwithODAC122010.zip) for solution.

engntsn
  • 11
  • 1
0

Looks like you did not install the Oracle Instant client (or any other version of Oracle Client). This is a prerequisite for unmanaged ODP.NET provider.

Install the Oracle Instant client and you are fine. Otherwise you will get nothing but trouble.

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110