On Windows, the Oracle client library keeps the same name between versions;
it's oci.dll.
The functions and data structures are also generally compatible between
versions, and runtime linking with DLLs on Windows is all done by the name
of the exported function; there's no need to worry about whether it's at a
different offset in the library.

So if you compile and link an application (including DBD::Oracle) against
Oracle 8i, it will be able to link at runtime against 8i, 9i or 10g Oracle
client libraries.

It's even possible to compile against a 10g client and then at runtime use a
9i or 8i client library, provided you only use OCI functions in the lowest
version; e.g. if you use OCILobRead2 then it'll fail against a 9i client as
that function doesn't exist there.

More recently, the PPM version (optionally?) bundles Oracle Instant Client
10g with the distribution, so it effectively installs the Oracle client it
was compiled against in the first place.

On Unix, the shared library changes names between versions, e.g.
libclntsh.so.9.0, libclntsh.so.10.1.
There is a symlink libclntsh.so in each version, but DBD::Oracle appears to
link to the library including the major version number, so this change of
name breaks compatibility right off when changing the client. I don't know
enough about runtime linking on Unix to say for sure whether there are other
issues, although I can see that against 10g it links against another library
(libnz10.so) that doesn't even appear to have an equivalent in 9i.

I wonder if it is possible to link DBD::Oracle against the "libclntsh.so"
symlink?

It's still best practice to compile DBD::Oracle against the same client
it'll be using at runtime.

-----Original Message-----
From: Capacio, Paula J [mailto:[EMAIL PROTECTED] 
Sent: 19 December 2006 20:16
To: dbi-users@perl.org
Subject: DBD-Oracle and Oracle versions

>From lurking around this mail list over the years,
I've seen numerous items relating to building 
DBD-Oracle against a specific version of the Oracle
client software on *nix systems.  

Example: if DBD-Oracle was built using version 9, 
then the Oracle client is upgraded to 10g; 
it is necessary to rebuild DBD-Oracle with the 10g client.   

I have used Perl on HP/UNIX, AIX, Linux and Windows.
On the *nix systems, Perl came with the OS and I have
had to install the DBI and DBD-Oracle modules using 
the standard make process.  On windows, I used 
ActiveState Active Perl and PPM to install DBI and 
DBD-Oracle modules.  In the windows environment I 
never have to worry about which version of the Oracle
client is present and I can upgrade to a different 
client version of Oracle without having to reinstall 
the DBD-Oracle module.  

What trick allows PPM modules to work regardless of 
Oracle client versions?  Ultimately, I'd like to know 
if there is a way to 'make' the modules on *nix systems
so that they don't rely on a specific version?

Thanks in advance,
Paula

Reply via email to