Tuesday, May 3, 2016

Using both 32-bit and 64-bit Oracle Client

While trying to resolve Oracle Client bitness conflicts, I came across this post:

http://realfiction.net/2009/11/26/Use-32-and-64bit-Oracle-Client-in-parallel-on-Windows-7-64-bit-for-eg-NET-Apps/

I followed those instructions, using the 12c Instant Client downloads, and it resolved my error. In case that post disappears, here is a summary of the instructions (credit to Frank Quednau for his post):


  1. Download both Oracle Client packages (32-bit and 64-bit). I downloaded the following files (from Oracle.com):
    instantclient-basiclite-nt-12.1.0.2.0.zip
    instantclient-basiclite-windows.x64-12.1.0.2.0.zip
  2. Unblock both downloaded files before continuing
  3. Each of those .zip files contains a folder called instantclient_12_1; extract and rename that folder somewhere on the machine, e.g.:
    C:\oracle\12c_32   (this is instantclient_12_1 extracted from instantclient-basiclite-nt-12.1.0.2.0.zip)
    C:\oracle\12c_64  (this is instantclient_12_1 extracted from instantclient-basiclite-windows.x64-12.1.0.2.0.zip)
  4. Start an elevated Command Prompt (aka Run as Administrator)
  5. Change to %WINDIR%\system32, e.g.:
    C:\Windows\System32>
  6. Make a soft link that points to the 12c_64 folder:
    C:\Windows\System32>mklink /d 12c C:\oracle\12c_64
    symbolic link created for 12c <<==>> C:\oracle\12c_64
  7. Change to %WINDIR%\SysWOW64, e.g.:
    C:\Windows\SysWOW64>
  8. Make a soft link that points to the 12c_32 folder:
    C:\Windows\SysWOW64>mklink /d 12c C:\oracle\12c_32
    symbolic link created for 12c <<==>> C:\oracle\12c_32
  9. NOTE: Make sure that both symbolic links have the same name, e.g.:
    C:\Windows\System32\12c
    C:\Windows\SysWOW64\12c
  10. Edit your system %PATH% environment variable and add the full path (do not use %WINDIR%) to the first symbolic link:
    ...;C:\Windows\System32\12c;
  11. Restart your machine, or at least restart whatever application is connecting to Oracle
With this setup, TNSNAMES.ORA does not seem to work. Instead, put the full descriptor directly in the connection string:

Data Source=(DESCRIPTION = (ADDRESS = (PROTOCOL = TCP)(HOST = 127.0.0.1)(PORT = 1521))(CONNECT_DATA = (SERVER = DEDICATED) (SERVICE_NAME = XE)));User ID=someuser;Password=yourpassword;

No comments:

Post a Comment