RE: Anyone using a 64-bit APP with a 32-bit Oracle Client? {Resolved}

From: Taylor, Chris David <ChrisDavid.Taylor_at_ingrambarge.com>
Date: Fri, 2 Sep 2011 07:39:33 -0500
Message-ID: <C5533BD628A9524496D63801704AE56D6A32379734_at_SPOBMEXC14.adprod.directory>



It would seem that this is an OS limitation, not an architecture limitation per this article at Intel:

Source: http://software.intel.com/en-us/articles/all-about-64-bits/

#1



Intel 64 (AMD64) architecture
The architecture Intel 64 we are discussing here, is a simple yet powerful backward compatible extension of the obsolete industry architecture x86. It adds the 64-bit address space and extends register resources for the purpose of higher performance of recompiled 64-bit applications. *The architecture supports obsolete 16-bit and 32-bit code of applications and operating systems without modifying or recompiling them*

A special feature of Intel 64 is support of sixteen 64-bit general-purpose registers (there were eight 32-bit registers in x86-32). There is also support for 64-bit arithmetic and logical operations over integer numbers. To address new registers, instructions were provided with "register extension prefixes" for which the range of codes 40h-4Fh was chosen which are used for INC <register> and DEC <register> instructions in 32-bit and 16-bit modes. The instructions INC and DEC must be coded in a more general, two-byte form in the 64-bit mode.

Registers:

16 integer 64-bit general-purpose registers (RAX, RBX, RCX, RDX, RBP, RSI, RDI, RSP, R8 - R15),

8 80-bit floating-point registers (ST0 - ST7),

8 64-bit Multimedia Extensions registers (MM0 - MM7, they share space with the registers ST0 - ST7),

16 128-bit SSE registers (XMM0 - XMM15),

64-bit RIP pointer and 64-bit flag register RFLAGS.

The need for a 64-bit architecture is determined by applications that need a large address space. First of all, these are high-performance servers, data managers, CAD and, of course, games. These applications will get significant benefits from the 64-bit address space and extended number of registers. Few registers available in the obsolete x86 architecture limit performance in computational tasks. The increased number of registers provides sufficient performance for many applications.

Let us point out the main advantages of the x86-64 architecture:

64-bit address space;
extended register set;
instruction set familiar to developers;
capability to launch obsolete 32-bit applications in a 64-bit operating system; capability to use 32-bit operating systems.


#2



Win64 program model
Like in Win32, the size of pages in Win64 is 4 Kbytes. The first 64 Kbytes of the address space are never displayed, that is the least correct address is 0x10000. Unlike Win32, system DLLs can be loaded for more than 4 Gbytes.

The specific feature of compilers for Intel 64 is that they can most effectively use registers to pass parameters into functions instead of using the stack. It allowed the developers of the Win64 architecture to get rid of such a notion as calling convention. In Win32, you may use different conventions: __stdcall, __cdecl, __fastcall, etc. In Win64, there is only one calling convention. Let us consider an example of how four arguments of integer type are passed in registers:

RCX: the first argument
RDX: the second argument
R8: the third argument
R9: the fourth argument
The arguments after the first four integers are passed on the stack. To pass float arguments, XMM0-XMM3 registers are used as well as the stack.

**The difference between the calling conventions results in an impossibility to use both 64-bit and 32-bit code in one program. In other words, if an application is compiled for the 64-bit mode, all the DLL libraries being used must be also 64-bit.**

Passing of parameters through registers is one of the innovations that make 64-bit programs faster than 32-bit ones. An additional performance gain might be obtained if you use 64-bit data types.


Now I think I understand the "why" of it.

Thanks,

Chris Taylor
Sr. Oracle DBA
Ingram Barge Company
Nashville, TN 37205
Office: 615-517-3355
Cell: 615-663-1673
Email: chris.taylor_at_ingrambarge.com

CONFIDENTIALITY NOTICE: This e-mail and any attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender immediately and delete the contents of this message without disclosing the contents to anyone, using them for any purpose, or storing or copying the information on any medium.

-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Taylor, Chris David Sent: Friday, September 02, 2011 6:52 AM To: 'Dunbar, Norman (Capgemini)'; 'oracle-l_at_freelists.org' Subject: RE: Anyone using a 64-bit APP with a 32-bit Oracle Client?

It makes sense that a 32-bit app needs a 32-bit client. The 32-bit client DLLs are compiled with 32-bit libraries.

It does *not* make sense that a 64-bit app needs a 64-bit client however because it is my understanding that a 64-bit library contains the same information as the 32-bit library but in different byte positions due to being compiled with 64-bit libraries. In my mind, a 64-bit app should be able to find the hooks in a 32-bit dll just as easily as in a 64-bit dll.

Yes, I'm fairly certain that Oracle SQL Developer 64-bit is 64-bit. It requires a 64-bit JRE and if it was a 32-bit app the 64-bit JRE wouldn't work I think.

Chris Taylor
Sr. Oracle DBA
Ingram Barge Company
Nashville, TN 37205
Office: 615-517-3355
Cell: 615-663-1673
Email: chris.taylor_at_ingrambarge.com

CONFIDENTIALITY NOTICE: This e-mail and any attachments are confidential and may also be privileged. If you are not the named recipient, please notify the sender immediately and delete the contents of this message without disclosing the contents to anyone, using them for any purpose, or storing or copying the information on any medium.

-----Original Message-----
From: Dunbar, Norman (Capgemini) [mailto:norman.dunbar.capgemini_at_environment-agency.gov.uk] Sent: Friday, September 02, 2011 3:00 AM To: Taylor, Chris David; oracle-l_at_freelists.org Subject: RE: Anyone using a 64-bit APP with a 32-bit Oracle Client?

Hi Chris,

>> Subject: Anyone using a 64-bit APP with a 32-bit Oracle Client?
Nope, it doesn't work. 64 bit OS can run 32 bit apps as well as 64 bit - if they have the required support "packages" installed. However, a 64 bit app needs a 64 bit Oracle Client in a manner similar to how a 32 bit app, running on 64 bit OS, needs the 32 bit Oracle Client.

>> Oracle note 1151394.1 says .....
>> Is that always true though?

Yes. (For certain values of "always" perhaps!)

>> For example, the SQL Developer
>> 64-bit version from Oracle runs with my 32-bit client libraries
>> though it may be doing something different since it uses Java.
Are you sure that SQL Developer is actually a 64 bit app? It may be that it claims 64 bitness but is really "64 bit compatible in such a way that it will actually run on 64 bit OS" - in other words, it's really 32 bit!

I can't say for sure, I'm most definitely a Toad man myself, and I know that the Toad support lists get frequent postings about this very matter - "I've installed Toad on 64 bit Windows and it says I don't have an Oracle Client installed, but I have 64 bit Oracle 11.2 Client". Toad is created by Delphi, and until Delphi XE2 hits the streets, Delphi creates 32 bit applications which require 32 bit supporting infrastructure, even if running on a 64 bit OS.

>> I was trying to find a 64-bit app that had database connectivity to
>> test some scenarios but I can't easily locate one.
I'm not aware of any - until the development tools for 64 bit apps are a lot more popular (in use) then we will be stuck with 32 bit stuff running on 64 bit OSs.

HTH Cheers,
Norm.

Norman Dunbar
Contract Senior Oracle DBA
Capgemini Database Team (EA)
Internal : 7 28 2051
External : 0113 231 2051

Information in this message may be confidential and may be legally privileged. If you have received this message by mistake, please notify the sender immediately, delete it and do not copy it to anyone else.

We have checked this email and its attachments for viruses. But you should still check any attachment before opening it. We may have to make this message and any reply to it public if asked to under the Freedom of Information Act, Data Protection Act or for litigation. Email messages and attachments sent to or from any Environment Agency address may also be accessed by someone other than the sender or recipient, for business purposes.

If we have sent you information and you wish to use it please read our terms and conditions which you can get by calling us on 08708 506 506. Find out more about the Environment Agency at www.environment-agency.gov.uk

--
http://www.freelists.org/webpage/oracle-l




--
http://www.freelists.org/webpage/oracle-l
Received on Fri Sep 02 2011 - 07:39:33 CDT

Original text of this message