Home > Not CodeFluent Related :), Oracle Database > Setting-up Oracle Database for .NET development

Setting-up Oracle Database for .NET development


I recently had to set-up a new development environment for a .NET application consuming an Oracle Database and found out that it wasn’t that easy, so I thought I’d share how I did it.

 

Warranty

I’m just sharing my config and the way I did it.

SoftFluent cannot be held responsible if something goes wrong or does not work, and no support is provided. It’s neither official documentation nor the only way to do it, I’m just sharing my recipe Smile

 

Prerequisites

I downloaded and installed a free Oracle Database Express Edition.

The 11g Release 2 is available here: http://www.oracle.com/technetwork/products/express-edition/downloads/index.html

Yet, in this case I had to install a 10g in 32-bit which can’t be found on OTN anymore…..except on a Japanese OTN page?!!

If you need the Oracle Database 10g Express Edition (x86) as I did here’s the link: http://www.oracle.com/technetwork/jp/database/express-edition/downloads/102xewinsoft-089442-ja.html

 

Installing the Server

Nothing special here: install OracleXE.exe, keep everything by default:

  • installation directory: C:\oraclexe
  • default port: 1521
  • configure the SYS or SYSTEM account

Once installed, an administration web page should start. Check that everything runs fine, if so, you’re done, now let’s prepare it for the .NET world!

 

Installing OCI & ODP.NET

Oracle Call Interface (OCI) is the basic and compulsory method to access Oracle using a client. On top of OCI, we’ll need the Oracle Data Access Components (ODAC). Both OCI and ODAC are a set of dlls and that are shipped as a ZIP, available on Oracle’s web site (http://www.oracle.com/technetwork/database/windows/downloads/utilsoft-087491.html).

In my case I specifically needed the ODAC1110621Xcopy.zip, in your case just be careful to use an ODAC version matching your Oracle Database version and bitness.

Then here’s how I configured my environment:

  • I created a “C:\oracle” just like OracleXE did,
  • I extracted the content of my ODAC1110621Xcopy.zip archive in this directory,
  • I removed the path C:\oraclexe\app\oracle\product\10.2.0\server\bin” from my PATH environment variable…
  • …and added the “C:\oracle\instantclient_11_1” in the PATH so my OCI dlls are used,
  • I copied the Oracle.DataAccess.dll that is in “C:\oracle\odp.net20\odp.net\bin\2.x\” in “C:\oracle\instantclient_11_1”,
  • I removed all Oracle.DataAccess.dll from the GAC so I’ll be sure my .NET apps we’ll always use the Oracle.DataAccess.dll they reference,
  • I copied the OraOps11w.dll contained in the “C:\oracle\bin” in “C:\oracle\instantclient_11_1”

 

Installing SQL Developer

image

 

Setting-up CodeFluent Entities

Since we removed Oracle.DataAccess.dll from the GAC, we need to place it in CodeFluent Entities directory so the Oracle Database Producer can access it.

 

Hope this helps,

Carl Anderson

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 51 other followers