10

I have 64-bit Oracle Database Server (11.2.0.3) installed on Windows 2008 R2, and naturally, it automatically installs the 64-bit client. I have to install an application onto this server that is 32-bit and requires the 32-bit Oracle client. (Don't Ask - I can't install the 64-bit version of this app, it won't work with the 64-bit client, and I can't install it on another server.)

Now i have tried installing the 32-bit Client into a different physical folder and selected a different value for the Oracle Base and Software Location when installing and it installed just fine. And it put the BIN folder of the 32-bit Client installation at the head of the PATH statemtn.

However, when i tried to run "SQLplus system/system" with the 32-bit version it gives me the "ORA-12560: TNS:protocol adapter error". When I go into the folder with the 64-bit sqlplus.exe and ran it (directly and not through PATH), the "system/system" credentials worked fine.

I copied the TNSNames folder from the Oracle Server's NETWORK/admin folder to the Oracle Client's NETWORK/admin folder, and rebooted the server. Same results.

This is the extent of my troubleshooting knowledge for Oracle.

How can i get the 32-bit Client to run on the same server as the 64-bit Oracle Server? I know in linux/Unix, you simply put in the lib32 folder into the the 64-bit client folder and set a couple of environment variables, but i'm pretty sure it's not that simple in Windows.

If there is a way to do this, please be descriptive in you answer as I will need step-by-step instructions.

Thanks in advance.

BeekerC
  • 101
  • 1
  • 1
  • 3

2 Answers2

31

Here is an instruction how to install 32-bit and 64-bit Oracle Client on one machine. Follow the instruction, then it should work.

Assumptions: Oracle Home is called OraClient11g_home1, Client Version is 11gR2

  • Download and install Oracle x86 Client, for example into C:\Oracle\11.2\Client_x86

  • Download and install Oracle x64 Client into different folder, for example to C:\Oracle\11.2\Client_x64

  • Open command line tool, go to folder %WINDIR%\System32, typically C:\Windows\System32 and create a symbolic link ora112 to folder C:\Oracle\11.2\Client_x64 (see commands section below)

  • Change to folder %WINDIR%\SysWOW64, typically C:\Windows\SysWOW64 and create a symbolic link ora112 to folder C:\Oracle\11.2\Client_x86, (see below)

  • Modify the PATH environment variable, replace all entries like C:\Oracle\11.2\Client_x86 and C:\Oracle\11.2\Client_x64 by C:\Windows\System32\ora112, respective their \bin subfolder. Note: C:\Windows\SysWOW64\ora112 must not be in PATH environment.

  • If needed set your ORACLE_HOME environment variable to C:\Windows\System32\ora112

  • Open your Registry Editor. Set Registry value HKLM\Software\ORACLE\KEY_OraClient11g_home1\ORACLE_HOME to C:\Windows\System32\ora112. Using C:\Oracle\11.2\Client_x64 should also work.

  • Set Registry value HKLM\Software\Wow6432Node\ORACLE\KEY_OraClient11g_home1\ORACLE_HOME to C:\Windows\System32\ora112 (not C:\Windows\SysWOW64\ora112). Using C:\Oracle\11.2\Client_x86 should also work.

  • You are done! Now you can use x86 and x64 Oracle client seamless together, i.e. an x86 application will load the x86 libraries, an x64 application loads the x64 libraries without any further modification on your system.

  • Probably it is a smart idea to set your TNS_ADMIN environment variable (resp. TNS_ADMIN entries in Registry) to a common location, for example TNS_ADMIN=C:\Oracle\Common\network\admin

Commands to create symbolic links:

cd C:\Windows\System32
mklink /d ora112 C:\Oracle\11.2\Client_x64
cd C:\Windows\SysWOW64
mklink /d ora112 C:\Oracle\11.2\Client_x86

Notes:

Both symbolic links must have the same name, e.g. ora112.

Despite of their names folder C:\Windows\System32 contains the x64 libraries, whereas C:\Windows\SysWOW64 contains the x86 (32-bit) libraries. Don't get confused.

Background information, why this works: Registry Redirector and File System Redirector

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • Is there a reason for downvote without any comment. Just in case you don't like a link as an anser I will copy my text here. – Wernfried Domscheit Aug 10 '14 at 15:24
  • Wernfried, I'm new to this forum, so if i downvoted your comment by accident, i apologize, however, i don't think i did. i do have a followup though. in my scenario, Oracle 64-bit server (and client) are already installed. does this make a difference, because it looks like your method presumes neither client is installed. it also looks like you recommend installing the 32-bit client before the 64-bit client. and in my case, that can't be done. just don't know if this will be an issue. many thanks for responding. I'll give this a shot and see what happens. – BeekerC Aug 10 '14 at 21:41
  • It's a generic instruction, the order does not matter. After installation of Oracle Clients you can execute even each line in any order. Only important point is: The 32-bit and the 64-bit Client have to be installed in different directories. – Wernfried Domscheit Aug 11 '14 at 05:33
  • Another note: You can either copy files at `NETWORK/admin` to both locations or you define environment variable `TNS_ADMIN`, e.g. `TNS_ADMIN=c:\Settings\Oracle\admin`. This will be then used by any Oracle Client. – Wernfried Domscheit Aug 11 '14 at 05:38
  • Works great! One note - the %WINDIR%\SysWOW64\System32 should be %WINDIR%\SysWOW64. There is no folder called System32 in SysWOW64. – Jeff Pearce Jun 20 '16 at 23:04
  • @JeffPearce, thank you for the note, it is corrected. Hardly believable that nobody noticed this mistake despite of 7 up-votes. – Wernfried Domscheit Jun 21 '16 at 05:52
2

I had the same issue. Both 32 and 64 bit ORA clients installed on same Windows 10 machine (separate folders) and 32 bit apps stopped working. All I had to do was edit the System Environment variables and DELETE the ORACLE_HOME entry, then re-boot. Windows/Oracle do the rest based on the registry entries. Just need to copy the tnsnames.ora to both installations.

narasik
  • 21
  • 1