What is the minimal setup required to be able to deploy a .NET application that talks to an Oracle database?
-
2http://stackoverflow.com/questions/70602/what-is-the-minimum-client-footprint-required-to-connect-c-to-an-oracle-database – Mac Sep 09 '09 at 11:51
4 Answers
Josh-
Thank you very much for taking the time to answer. Your instructions helped a whole lot, and are very close to what I have found on my own.
Interestingly enough, I found it can be slimmed a little more.
For those in my situation who
- Do not want their users to have to install ODAC or the full-size Oracle Client
- Do not care about the re-usability of the particular client installtion
- Need a "clickOnce" compatible solution
I found a way to do that.
a. Download the "Oracle Instant Client 11.1.0.6 - Basic Lite". b. unzip to any folder and copy the following files to your Visual Studio project root:
- oci.dll
- ociw32.dll
- orannzsbb11.dll
- oraocci11.dll
- oraociicus11.dll
msvcr71.dll (not necessary, should be supplied with most Windows versions)
(the first five are the minimum needed for the Oracle Instant Client, the last is the microsoft common runtime they use.)
c. Download the ODAC 11 XCopy (the current version is 11.1.0.6) and unzip.
OraOps11w.dll - in the odp.net20 folder, goes in your project root.
(this file is what the Oracle.DataAccess.dll talks to and uses to work with the Instant Client files).
d. For compatibility with ClickOnce deployment, select these files in your project and make sure they are "Content" and "Copy Local" in your project. The manifest will then deploy them properly.
Result... the payload added to your project is 30mb, which kinda sucks, but much better than 100+ or 400+, supports western characters, but kicks butt in that
- it requires no path,
- requires no registry entries,
- is isolated in deployment and does not hose other Oracle Client installations,
- works will all DBs back through 9.2.

- 1,106
- 1
- 18
- 21
-
Thank you. I was unable to run an app build for ODAC, and the thing was, I forgot the necessary DLL's. – maxwellb Aug 23 '10 at 14:31
-
-
This worked very well if no Oracle client is installed. But I observed some conflicts if an Oracle client or server (e.g. on my developer machine) is installed (of different version than to be deployed). In this case I have to avoid putting the instant client DLLs in the bin folder of the Visual Studio project. – Stefan Nobis Aug 01 '12 at 17:00
-
The Oracle client can break installs done this way, because the Oracle client deploys Oracle.DataAccess.dll in the GAC. If the version numbers don't match with that and the dlls deployed (the GAC version of Oracle.DataAccess.dll loads instead of the local version), you will get errors. You almost need to check for an existing client install to ensure compatibility. Also, I deploy without orannzsbb11.dll, so I don't think that file is necessary. – Lathejockey81 Aug 25 '14 at 21:25
-
@Lathejockey81 Can't this be avoided simply by also including `Oracle.DataAccess.dll` to ensure your local copy is used? – Nyerguds Oct 02 '17 at 09:47
-
@Nyerguds Probably. I really don't care anymore since they've finally added a managed library. You don't have to do any of this unless you need a couple functions the managed library never ported over. – Lathejockey81 Oct 05 '17 at 16:47
- Download the ODAC 11 XCopy deployment.
Extract the zip file and run the following:
install.bat odp.net20 c:\oracle\11.1\odac myoraclehome true
Copy the files from the 11.1 directory and place them in a subdirectory of your application's executable (e.g. debug\bin\oracle)
Add the following statements to your Main() method. They will change the path such that your application executable will use the oracle client exclusive of any other oracle home's. The environment change is exclusive to your process and has no lasting effects when the application terminates:
Environment.SetEnvironmentVariable("PATH", Environment.CurrentDirectory + "\\oracle\\11.1\\odac;" + Environment.CurrentDirectory + "\\oracle\\11.1\\odac\\bin;", EnvironmentVariableTarget.Process);
Environment.SetEnvironmentVariable("ORACLE_HOME", Environment.CurrentDirectory + "\\oracle\\11.1\\odac", EnvironmentVariableTarget.Process);

- 27,301
- 27
- 95
- 148
-
59
-
With ODAC 11.2, the footprint of the true xcopy deploy (as described by trey above) balloons to 130MB. If you're deploying a lot of apps, this footprint grows quickly. Josh's solution above (install to one dir, have unmanaged DLLs addressable via PATH) is a good alternative. – Martin Suchanek Jan 24 '12 at 01:45
-
2An alternative to programatically changing the PATH at runtime is to use the app config setting: configuration/oracle.dataaccess.client/settings/add name="DllPath" to tell the oracle drivers where the unmanaged dll path is. See http://docs.oracle.com/html/E15167_01/InstallODP.htm Section "Search Order for Unmanaged DLLs". This method will also ensure support for side by side versioning. – Martin Suchanek Jan 24 '12 at 01:47
-
2
A while back, this is the thread that got my program working (THANKS!). I now have been told that Oracle doesn't like you picking out 6 dlls and dropping them into your executable folder. So now, every dll that gets installed when running install.bat odp.net2 c:\oracle odac has to placed in your executable folder (eating up space)

- 31
- 1
-
Very helpful, I was trying and trying to bin deploy the dlls with no success as lots of people were saying you could. Then I saw this answer with a more recent date and reliased all the other posts were relatively old. I gave up trying to bin deploy the dlls, and just ran 'install.bat odp.net4 c:\oracle odac' on the server. – Robert Brooker Apr 25 '13 at 21:39
Im running with the oracle instant client 11g. The following, and very minimal, list of files is what ive found necessary for deployment:
OCI.dll
Oracle.DataAccess.dll
OraOCIEI11.dll
OraOps11w.dll
Just install the full client and copy those files from the bin folder.

- 24,267
- 23
- 130
- 154

- 133
- 2
- 9
-
1
-
-
1Alas, I can't get this to work. I've added the DLLs to my setup project and they get deployed along with my .EXE (which is a Windows Service, if that matters). When attempting to start the service I get a TypeInitializationException claiming "The provider is not compatible with the version of Oracle client" - which is the same thing it said when I had only Oracle.DataAccess.dll (the provider/wrapper). Presumably the DLLs are unmanaged, so I don't think I should (or could) put them in the GAC. Is any registration/installation required beyond "xcopy deployment"? – The Dag Aug 11 '11 at 09:31
-
As far as I understand and tested this, the above small set of just 4 DLLs is not enough if you have nothing from Oracle installed (but it works fine if you have a Oracle instant client installed). The solution presented by trey works fine on client-less computers (but it may conflict with an installed client). – Stefan Nobis Aug 01 '12 at 16:57