Tuesday, February 7, 2012

Concurrent Oracle 11.2.0.2 32-bit and 64-bit ODBC on Windows 7 x64

Whilst installing the latest Oracle InstantClient 11.2.0.2 with ODBC on Windows 7 I've discovered something new.

=> Both the 32-bit and 64-bit drivers can co-exist.  A single User Data Source can be used for both 32-bit and 64-bit applications.  This means they can be maintained with the default 64-bit ODBC Data Source Administrator.  No more switching between the 32-bit and 64-bit ODBC Administrators.

Why does this work?  

  1. The ODBC Data Source entries for the User DSN are stored in a shared location in the registry (HKCU/Software/ODBC).  Items in this location are not redirected for 32-bit to the Wow6432Node tree.
  2. The ODBC Driver entries are stored in a redirectable location in the registry (HKLM/Software/ODBC).  Items in this location redirect to the Wow6432Node tree (HKLM/Software/Wow6432Node/ODBC).
  3. The Driver names for both 32-bit and 64-bit entries are the same.  Hence, applications will obtain the data source information from the shared location, then obtain the driver location from the redirectable entries.
  4. Whilst the Driver location is specified in the shared DSN entries, there is no reliance on that location.  There is a fallback to the ODBC Driver entries in the registry.
The configuration


I have the 64-bit driver installed in c:\oracle\instantclient_11_2_64, and the 32-bit driver installed in c:\oracle\instantclient_11_2.  The driver name is "Oracle in instantclient_11_2".

When doesn't it work?


This will not work for System Data Source entries as these are stored in the redirectable location (HKLM/Software/ODBC).