Introduction
Whilst one would expect to normally only use either a 32-bit or a 64-bit Oracle client software install there are circumstances where you may be using a mixture of software built to both the 32bit and 64bit models. This was the case with a Business Objects server that I was recently asked to help configure for a client. Why might this happen? Well you may have a mixture of some quite old legacy apps written using the 32 bit model plus some more modern apps written to the 64 bit model all running on the same server. Is this great idea? No but it happens. and you may be in a situation where you are forced into doing this. This document provides details of this combined installation and the configuration required to allow both 32bit and 64bit applications to function correctly. There have been statements made by various parties that Oracle supports this and have provided a patch so that it works “out-of-the-box”. As of October 2021 as far as my research is concerned this is not the case and the steps outlined in this document need to be carried out to ensure that the 32-bit and 64-bit client installs function correctly.
Installation & Configuration
Install Oracle 64-bit Client
First download and install the 64bit Oracle client from the Oracle Technology Network[1] (OTN). In this example installation the ORACLE_HOME directory path is E:\app\SVRC_OraClient\productt\19.0.0\client1
Install Oracle 32-bit Client
Next download and install the 34bit Oracle client, again from the Oracle Technology Network. For this example installation the ORACLE_HOME directory path for the 32 bit client software is E:\app\SVRC_OraClient\productt\19.0.0\client2
WoW64 File System Redirection
Once Microsoft decided to release a 64 bit version of Windows it was a fundamental requirement that 64bit Windows be capable of running both 64bit and 32bit software. One of the key elements is the support of Dynamic Link Libraries (DLLs) . DLLs are libraries of supporting software provided by Microsoft (And others) to provide a multitude of different functionality to user written programs, for example all the building blocks for creating and driving a GUI interface.
In 64 bit Windows, by default, a running program looks for any Dynamic Link Libraries (DLLs) it needs in the directory location %WINDIR%\System32 (typically C:\Windows\System32 on most installations) As an aside, it may seem odd that 64bit DLLs are maintained in a directory called “system32” but this directory has been the traditional “system” directory since the first release of Windows NT (32 bit only) and Microsoft have elected not to change its name. With the advent of 64 bit Windows the issue of being able to run 32bit software on a 64 bit version of the operating system became part of the landscape. (Note it is not possible to run 64bit applications on a 32bit Windows Installation) To allow 64 bit Windows to run 32 bit programs Microsoft developed WoW64 (Windows 32-bit on Windows 64-bit) There are a number of elements to WoW64 but the one most pertinent to supporting both 32bit and 64bit Oracle client software is known as the “File System Redirector” see this File System Redirector Article for more information.
When a 32bit program runs it will attempt to search for its DLLs in the default location %WINDIR%\System32 but as we have said on 64 bit Windows that directory contains only 64bit DLLs. What happens is that, unbeknownst to the 32bit program, the OS detects that a 32 bit program is running and trying to access DLLs that need to be 32-bit and silently redirects the search to the directory %WINDIR%\SysWOW64. The %WINDIR%\SysWOW64 directory contains the 32bit equivalents of the DLLs contained in %WINDIR%\System32. The first diagram below shows a 64bit application accessing a 64bit DLL. It is important to note that the 32-bit Windows application is completely unaware that this “magic” is happening and it behaves as though it is running on a 32-bit version of Windows.
The next diagram shows a 32bit application apparently trying to access a 32bit DLL in the same location as the 64bit DLLs but being redirected. The 32bit application is unaware of this redirection
Using the Redirector to support 32bit & 64bit Oracle Clients
Oracle Client software has its own binary directories for executables and DLLs. It does not make use of the %WINDIR%\system32 or %WINDIR%\SYSWoW64 directories. These are effectively reserved for Microsoft. The solution to allow the Oracle Client 32bit and 64bit software to co-exist involves making use of the File System redirector capability described in the previous section. The File system redirector kicks in when any program attempts to access any file in either %WINDIR%\system32 or %WINDIR%\SysWOW64. Rather than move the Oracle binaries into those directories, which would introduce other issues, we create create the illusion that the Orcale client software is in these locations by using “softlinks”[1] in the %WINDIR%\system32 and the %WINDIR%\SysWOW64 directories as explained below. In doing this we don’t move any executable files or DLLs but we cause any software that uses the Oracle 32bit Client to “Pass through” %WINDIR%\system32 thereby triggering the OS file system redirection mechanism to give us the behaviour we want.
Create a softlink in %WINDIR%\system32
Create a softlink as shown below. The /j switch creates a junction[2] the first path is the path of the softlink and the second path is what it points to.
mklink /j c:\windows\system32\oracle E:\app\SVRC_OraClient\product\19.0.0\client1
Create a softlink in %WINDIR%\sysWOW64
Create a softlink as shown below. The /j switch creates a junction the first path is the path of the softlink and the second path is what it points to.
mklink /j c:\windows\SysWOW64\oracle E:\app\SVRC_OraClient\product\19.0.0\client1
Other changes required/Advised
Environment Variables
There are various environment variables that are either required or recommended. These can be set on a per user basis but for the tactical solution I was engineering for a Business Objects server I elected to make them system wide.
Variable | Required? | Purpose | |
ORACLE_HOME | Yes | C:\Windows\System32\Oracle | Forces Oracle binaries to go via the system32 directory which brings file system redirection into play |
TNS_ADMIN | Recommended | E:\App\SVRC_OraClient\product\
19.0.0\client_1\network\admin |
With two installs of Oracle client there are two locations for the files that configure Oracle TNS network access. Setting this variable causes all network configuration to be pulled from the 64bit version of the directory irrespective of whether 32bit or 64bit software is being used |
[1] Softlinks (AKA symbolic links) are a reference to another file or directory. They are essentially text that contains either an absolute or relative path to the object they are linking to. The have been a feature of UNIX like operating systems for many decades. They first appeared in Windows with the advent of NTFS version 3.1.
[2] A junction is a Windows specific type of link that can only point to another directory (absolute path only) on a local volume. A symbolic link on the other hand can point to an object on a remote fileshare
[1] The OTN can be accessed by anyone and it is not necessary to have an active Oracle support contract (Registration is required) The OTN can be accessed here