As you know that Oracle recently released 64-bit client (Both ODAC and ODP.NET), I was struggling
for ways to run both the 32-bit and 64-bit versions side-by-side so that I can decide whether to run the application in 64-bit or in 32-bit mode on (64-bit Platform) at startup. Furthermore, I also did a research on installing both 64-bit and 32-bit Oracle clients on the same box. I am writing the steps necessary for the same.
for ways to run both the 32-bit and 64-bit versions side-by-side so that I can decide whether to run the application in 64-bit or in 32-bit mode on (64-bit Platform) at startup. Furthermore, I also did a research on installing both 64-bit and 32-bit Oracle clients on the same box. I am writing the steps necessary for the same.
1.Installing two Oracle Clients on the same machine:
a. Uninstall all the existing Oracle Clients.
b. Download ODP.NET with ODAC (both 32-bit and 64-bit clients) from Oracle Website.
c. Start with installing 64-bit Oracle Data Access Components with ODP.NET on the machine.
PS: Do not install 32-bit client first. Please uninstall any other Oracle clients before installing
the 64-bit client.
the 64-bit client.
d. Install the 32-bit Oracle Data Access Components with ODP.NET on the same machine (Take care
as to install on separate folders)
as to install on separate folders)
e. Copy the tnsnames.ora entries in both the client (x32 and x64) folders.
PS: Oracle has changed their versioning schema for ODP.NET. The previous ODP.NET Assemblies were named after the Oracle Version (like 9.10.2.3 or 10.1.0.201) but the recent ODP.NET releases would be named after their corresponding .NET Framework version (like Oracle Client for 10.1.0.201 would have a corresponding ODP.NET for .NET Framework 1.1 as 1.101.0.201 and ODP.NET for .NET Framework 2.0 as 2.102.0.201)
For more info, please refer to ODP.NET documentation on Oracle website.
2. Setup required files for 64-bit environment migration.
Download corflags.exe from .NET Framework SDK to a location which is in the environment path variables (pref. %SYSTEMROOT%)
3. Register 64-bit ODP.NET to GAC
a. Open command prompt and navigate to folder where 64-bit Oracle Client is installed.
b. Navigate to ODP.NET/2.x folder in the directory where 64-bit Oracle Client is installed.
c. Hit ODPReg.exe /i Oracle.DataAccess.dll
d. This will register the 64-bit ODP.NET Assemblies in 64-bit GAC (Located at %SYSTEMROOT%\Assembly\Oracle.DataAccess)
PS: There is no need to install/register the ODP.NET 32-bit Assemblies as the Oracle installer takes are of this.
4. Configuring Machine.config for 64-bit applications to access 64-bit ODP.NET
a. Open machine.config (in notepad or in a text editor) file located in
%SYSTEMROOT%\Microsoft.NET\Framework64\v2.0.50727\CONFIG folder.
%SYSTEMROOT%\Microsoft.NET\Framework64\v2.0.50727\CONFIG folder.
b. Browse through and add the following node after the node to the machine.config file.
PS: Please find the attached machine64.config for reference.
Notes:
1. Forcing an assembly which is complied in "Any CPU" mode to run in 32-bit mode on a 64-bit machine, use the CorFlags application provided by Microsoft.
corflags.exe /32BIT+
To undo the above operation use the following syntax:
corflags /32BIT-
2. Assembly Binding Log viewer helps us to know about the dependencies of an assembly and their runtime bindings. To enable the log, please go through the MSDN Documentation at http://msdn2.microsoft.com/en-us/library/e74a18c4(vs.71).aspx
3. For forcing an assembly to use specified version of Oracle DLL when running in 64-bit mode add the following node in the respective app.config file:
The processorArchitecture Attribute Enumeration can take the following values: amd64,
ia64, x86, MSIL. (which are self explanatory).
The following is the output from Assembly Log Viewer showing various configuration settings of a test assembly running in 64-bit/32-bit mode and the binding information taken from runtime.
Case 1: 64-bit machine.config file has been altered to support 64-bit Oracle client at
runtime, App is running in 64-bit mode
*** Assembly Binder Log Entry (5/18/2007 @ 9:11:23 PM) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from: C:\WINNT\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
Running under executable C:\Documents and Settings\ramade\Desktop\OraDllConnTester.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = AMERICAS\ramade
LOG: DisplayName =
Oracle.DataAccess, Version=10.2.0.100, Culture=neutral, PublicKeyToken=89b483f429c47342 (Fully-specified)
LOG: Appbase = file:///C:/Documents and Settings/ramade/Desktop/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = OraDllConnTester.exe
Calling assembly : OraDllConnTester, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Documents and Settings\ramade\Desktop\OraDllConnTester.exe.config
LOG: Using machine configuration file from C:\WINNT\Microsoft.NET\Framework64\v2.0.50727config\machine.config.
LOG: Redirect found in application configuration file: 10.2.0.100 redirected to 2.102.3.2.
LOG: ProcessorArchitecture is locked to AMD64.
LOG: Machine configuration policy file redirect found: 2.102.3.2 redirected to 2.102.3.2.
LOG: Post-policy reference: Oracle.DataAccess, Version=2.102.3.2,
Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64
LOG: Found assembly by looking in the GAC.
LOG: Binding succeeds. Returns assembly from C:\WINNT\assembly\GAC_64\Oracle.DataAccess\2.102.3.2__89b483f429c47342\Oracle.DataAccess.dll.
LOG: Assembly is loaded in default load context.
Case 2: Application running in 64-bit mode and
*** Assembly Binder Log Entry (5/18/2007 @ 9:13:25 PM) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from: C:\WINNT\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
Running under executable C:\Documents and Settings\ramade\Desktop\OraDllConnTester.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = AMERICAS\ramade
LOG: DisplayName = Oracle.DataAccess, Version=10.2.0.100, Culture=neutral, PublicKeyToken=89b483f429c47342
(Fully-specified)
LOG: Appbase = file:///C:/Documents and Settings/ramade/Desktop/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = OraDllConnTester.exe
Calling assembly : OraDllConnTester, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Documents and Settings\ramade\Desktop\OraDllConnTester.exe.config
LOG: Using machine configuration file from C:\WINNT\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Redirect found in application configuration file: 10.2.0.100 redirected to 2.102.3.2.
LOG: ProcessorArchitecture is locked to AMD64.
LOG: Post-policy reference: Oracle.DataAccess, Version=2.102.3.2, Culture=neutral, PublicKeyToken=89b483f429c47342, processorArchitecture=AMD64
LOG: Found assembly by looking in the GAC.
LOG: Binding succeeds. Returns assembly from C:\WINNT\assembly\GAC_64\Oracle.DataAccess\2.102.3.2__89b483f429c47342\Oracle.DataAccess.dll.
LOG:
Assembly is loaded in default load context.
Case 3: Application running in 32-bit mode and
*** Assembly Binder Log Entry (5/18/2007 @ 9:52:05 PM) ***
The operation was successful.
Bind result: hr = 0x0. The operation completed successfully.
Assembly manager loaded from:
C:\WINNT\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\Documents and Settings\ramade\Desktop\OraDllConnTester.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = AMERICAS\ramade
LOG: DisplayName = Oracle.DataAccess, Version=10.2.0.100, Culture=neutral, PublicKeyToken=89b483f429c47342
(Fully-specified)
LOG: Appbase = file:///C:/Documents and Settings/ramade/Desktop/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = OraDllConnTester.exe
Calling assembly : OraDllConnTester, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file:
C:\Documents and Settings\ramade\Desktop\OraDllConnTester.exe.config
LOG:
Using machine configuration file from
C:\WINNT\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG:
Post-policy reference: Oracle.DataAccess, Version=10.2.0.100, Culture=neutral, PublicKeyToken=89b483f429c47342
LOG: Found assembly by looking in the GAC.
LOG: Binding succeeds. Returns assembly from C:\WINNT\assembly\GAC\Oracle.DataAccess\10.2.0.100__89b483f429c47342\Oracle.DataAccess.dll.
LOG:
Assembly is loaded in default load context.
0 comments:
Post a Comment