Installing Oracle OLE DB drivers on Windows
Oracle provides ODAC Runtime Downloads, which contains drivers for Windows. These are available as:
- ODAC XCopy
- 64-bit ODAC OUI
The ODAC OUI gives you a graphical user interface for installation, but it only provides you with 64-bit version of the drivers. If you need 32-bit drivers, you will have to use the command-line ODAC XCopy.
Using ODAC XCopy you can install 64-bit or 32-bit OLE DB drivers for Oracle. You can also use ODAC XCopy to install the Oracle Instant Client which supports ODBC.
However, installing any of the drivers (32-bit or 64-bit) disables the other driver. How can you make them co-exist?
Side-by-side installation
The trick is to use Windows symbolic links. The Windows system folder will be in different locations depending on 64-bit or 32-bit mode. Using symbolic links, you can therefore create a path that points differently for 64-bit applications and 32-bit applications.
- C:\Windows\System32 for 64-bit applications
- C:\Windows\SysWOW64 for 32-bit applications
Here are the full steps:
- Download ODAC XCopy 64-bit and 32-bit from Oracle's website
- Unzip the files and open a command prompt as administrator. Go to the location of the unzipped files.
Oracle ODAC installation
- Run install.bat for the 64-bit driver:
install.bat oledb C:\Oracle\64bit odac
Go to the location of the unzipped files for the 32-bit driver and install from there:
install.bat oledb C:\Oracle\32bit odac
- Now create symbolic links to your driver folders:
cd C:\Windows\System32
mklink /d odac C:\Oracle\64bit
cd C:\Windows\SysWOW64
mklink /d odac C:\Oracle\32bit
- Edit your environment variables and add C:\Windows\System32\odac and C:\Windows\System32\odac\bin to your path:
Oracle Odac Path
Now the OLE DB driver will automatically be loaded from C:\Oracle\64bit or C:\Oracle\32bit depending on if in 64- or 32-bit architecture of your application.
No comments:
Post a Comment