Question

We have an OCCI application which is linked dynamically to occi lib on Solaris. Now during build we linked it with occi of Oracle 10.2.0.4 client but we want the same build to be able to run under Oracle 10G client as well as Oracle 11G client. But it seems that occi is not backward compatible as name of dynamic occi lib has a version in it.

e.g

md1sisun26:/tools/oracle/10.2.0.4/lib->dump -Lv libocci.so

libocci.so:

**** DYNAMIC SECTION INFORMATION ****
.dynamic:
[INDEX] Tag Value
[1] INIT 0xc6110
[2] FINI 0xc62b8
[3] SONAME libocci.so.10.1
[4] RUNPATH TLD_GLOBAL
[5] RPATH TLD_GLOBAL
[6] HASH 0xe8
[7] STRTAB 0x10488
[8] STRSZ 0x1fb42
[9] SYMTAB 0x41e8
[10] SYMENT 0x18
[11] CHECKSUM 0x25a3
[12] PLTSZ 0x4c80
[13] PLTREL 0x7
[14] JMPREL 0x3c450
[15] RELA 0x2ffd0
[16] RELASZ 0x11100
[17] RELAENT 0x18
[18] REGISTER 0x72
[19] REGISTER 0x86
[20] FEATURE_1 PARINIT
[21] FLAGS 0
[22] FLAGS_1 [ DISPRELDNE ]
[23] PLTGOT 0x1eb500
md1sisun26:/tools/oracle/10.2.0.4/lib->ls -lrt libocci.so
lrwxrwxrwx 1 oracle 15 Aug 10 2010 libocci.so -> libocci.so.10.1*

As you can see when we run our occi application under Oracle 11G client it fails as there is no libocci.so.10.1. Can anyone suggest a solution?

Was it helpful?

Solution

I have had the same problem some time ago. After a deep research, the only option I found was to build different executable versions for the different ORACLE servers (respectively, linked with the different versions of the library).

Of course, this could be done another way - runtime distinguish which version of the lib you need, have both versions installed and dynamically load the correct version of the library, using dlopen. But I never tried this, as I didn't actually need it. But it could work, as far as both library versions could be installed on the same machine at the same time without conflicting with each other. Sounds possible to me.


Here are two links, that may be helpful:

The first one shows, that you need to have specific library version for your specific environment. My problem was, that I had to have occi 10.2.0.4 on a RHEL5, which comes with libstdc++.so.6, while occi 10.2.0.4 depends on libstdc++.so.5. The only solution was to write in OCCI's forum (the second link), where after a while, they gave me the correct build, which was occi 10.2.0.4 built with libstdc++.so.6 and not with libstdc++.so.5

Luckily, you won't have such problems, but I decided, that this could be useful for you.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top