Can't run oracle instant client with unixODBC

Hello. I have 13.1-STABLE OS version and oracle instant client 64-bit for linux. I have enabled linux binary compatibility and unpacked client's files into /compat/linux/opt/oracle/instantclient_10_2 (i need exactly this version):
Code:
ls -l /compat/linux/opt/oracle/instantclient_10_2/
total 112634
-r--r--r--  1 root  wheel   1621582 20 апр.   2010 classes12.jar
-rwxrwxr-x  1 root  wheel     70742 20 апр.   2010 genezi
-r--r--r--  1 root  wheel      1525 20 апр.   2010 glogin.sql
lrwxr-xr-x  1 root  wheel        17 13 сент. 15:07 libclntsh.so -> libclntsh.so.10.1
-rwxrwxr-x  1 root  wheel  25306574 20 апр.   2010 libclntsh.so.10.1
-r-xr-xr-x  1 root  wheel   7856305 20 апр.   2010 libnnz10.so
lrwxr-xr-x  1 root  wheel        15 13 сент. 15:07 libocci.so -> libocci.so.10.1
-rwxrwxr-x  1 root  wheel   1669888 20 апр.   2010 libocci.so.10.1
-rwxrwxr-x  1 root  wheel  72703820 20 апр.   2010 libociei.so
-r-xr-xr-x  1 root  wheel    150417 20 апр.   2010 libocijdbc10.so
-r-xr-xr-x  1 root  wheel   1345921 20 апр.   2010 libsqlplus.so
-r-xr-xr-x  1 root  wheel   1436497 20 апр.   2010 libsqlplusic.so
lrwxr-xr-x  1 root  wheel        18 14 сент. 14:57 libsqora.so -> ./libsqora.so.10.1
-rwxrwxr-x  1 root  wheel   1016119 20 апр.   2010 libsqora.so.10.1
drwxr-xr-x  3 root  wheel         3 13 сент. 15:14 network
-r--r--r-x  1 root  wheel      3589 20 апр.   2010 odbc_update_ini.sh
-r--r--r--  1 root  wheel   1569316 20 апр.   2010 ojdbc14.jar
-r-xr-xr-x  1 root  wheel      9317 20 апр.   2010 sqlplus
With oracle instruction I've done:
Code:
ln -s libclntsh.so.10.1 libclntsh.so
ln -s libocci.so.10.1 libocci.so
Install the libaio package:
Code:
# pkg version | grep linux
linux-c7-libaio-0.3.109            =
linux_base-c7-7.9.2009             =
Code:
sudo sh -c "echo /compat/linux/opt/oracle/instantclient_10_2 > /compat/linux/etc/ld.so.conf.d/oracle-instantclient.conf
sudo ldconfig
and export some env variables:
Code:
$ env
ODBCSYSINI=/usr/local/etc
ODBCINI=/home/zabbix/.odbc.ini
ORACLE_HOME=/compat/linux/opt/oracle/instantclient_10_2
PATH=/compat/linux/opt/oracle/instantclient_10_2:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin:/home/zabbix/bin
LD_LIBRARY_PATH=/compat/linux/lib:/compat/linux/lib64:/compat/linux/opt/oracle/instantclient_10_2
Now I can use sqlplus, but when I try use isql - i get this error (I wrote driver settings right in ~/.odbc.ini:
Driver=/compat/linux/opt/oracle/instantclient_10_2/libsqora.so):
Code:
$ isql -v SR
[01000][unixODBC][Driver Manager]Can't open lib '/compat/linux/opt/oracle/instantclient_10_2/libsqora.so' : file not found
[ISQL]ERROR: Could not SQLConnect
Anyone has any advices where I'm wrong?
 
Code:
# /compat/linux/bin/ldd /compat/linux/opt/oracle/instantclient_10_2/libsqora.so
bash: /compat/linux/bin/ldd: /usr/bin/bash: bad interpreter: No such file or directory
but
Code:
# /compat/linux/bin/bash /compat/linux/bin/ldd /compat/linux/opt/oracle/instantclient_10_2/libsqora.so
        linux-vdso.so.1 =>  (0x00007fffffffe000)
        libdl.so.2 => /lib64/libdl.so.2 (0x0000000801600000)
        libm.so.6 => /lib64/libm.so.6 (0x0000000801a00000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x0000000801e00000)
        libnsl.so.1 => /lib64/libnsl.so.1 (0x0000000802200000)
        libclntsh.so.10.1 => not found
        libodbcinst.so.1 => not found
        libc.so.6 => /lib64/libc.so.6 (0x0000000802600000)
        /lib64/ld-linux-x86-64.so.2 (0x0000000001021000)
I have the first one
Code:
# ls -l /compat/linux/opt/oracle/instantclient_10_2/ | grep libclntsh
lrwxr-xr-x  1 root  wheel        17 13 сент. 15:07 libclntsh.so -> libclntsh.so.10.1
-rwxrwxr-x  1 root  wheel  25306574 20 апр.   2010 libclntsh.so.10.1
and I haven't the libodbcinst.so.1. Why linux ldd can't see libclntsh.so.10.1?
 
it's already done:
$ env | grep LD_
LD_LIBRARY_PATH=/compat/linux/lib:/compat/linux/lib64:/compat/linux/opt/oracle/instantclient_10_2
$ cat /compat/linux/etc/ld.so.conf.d/oracle-instantclient.conf
/compat/linux/opt/oracle/instantclient_10_2
Does the prefix "/compat/linux" must be in .conf file? I added it now, but early the record was as
$ cat /compat/linux/etc/ld.so.conf.d/oracle-instantclient.conf
/opt/oracle/instantclient_10_2
i run # /compat/linux/sbin/ldconfig and now
# /compat/linux/bin/bash /compat/linux/bin/ldd /compat/linux/opt/oracle/instantclient_10_2/libsqora.so
...
libclntsh.so.10.1 => /compat/linux/opt/oracle/instantclient_10_2/libclntsh.so.10.1 (0x0000000802600000)
libodbcinst.so.1 => not found
...
Thanks, i'll try to find libodbcinst.so.1.
 
# ls -l /usr/local/lib | grep odbc
-rw-r--r-- 1 root wheel 1296426 14 сент. 15:29 libodbc.a
-rwxr-xr-x 1 root wheel 925 14 сент. 15:29 libodbc.la
lrwxr-xr-x 1 root wheel 16 14 сент. 15:29 libodbc.so -> libodbc.so.2.0.0
lrwxr-xr-x 1 root wheel 16 14 сент. 15:29 libodbc.so.2 -> libodbc.so.2.0.0
-rwxr-xr-x 1 root wheel 449992 14 сент. 15:29 libodbc.so.2.0.0
-rw-r--r-- 1 root wheel 143566 14 сент. 15:29 libodbccr.a
-rwxr-xr-x 1 root wheel 939 14 сент. 15:29 libodbccr.la
lrwxr-xr-x 1 root wheel 18 14 сент. 15:29 libodbccr.so -> libodbccr.so.2.0.0
lrwxr-xr-x 1 root wheel 18 14 сент. 15:29 libodbccr.so.2 -> libodbccr.so.2.0.0
-rwxr-xr-x 1 root wheel 38328 14 сент. 15:29 libodbccr.so.2.0.0
-rw-r--r-- 1 root wheel 347918 14 сент. 15:29 libodbcinst.a
-rwxr-xr-x 1 root wheel 953 14 сент. 15:29 libodbcinst.la
lrwxr-xr-x 1 root wheel 20 14 сент. 15:29 libodbcinst.so -> libodbcinst.so.2.0.0
lrwxr-xr-x 1 root wheel 20 14 сент. 15:29 libodbcinst.so.2 -> libodbcinst.so.2.0.0
-rwxr-xr-x 1 root wheel 98288 14 сент. 15:29 libodbcinst.so.2.0.0
there is newer library, i add symlink ln -s libodbcinst.so.2 libodbcinst.so.1
and modify LD_LIBRARY_PATH:
$ env | grep LD_
LD_LIBRARY_PATH=/compat/linux/lib:/compat/linux/lib64:/usr/local/lib:/compat/linux/opt/oracle/instantclient_10_2
The result is
$ /compat/linux/bin/bash /compat/linux/bin/ldd /compat/linux/opt/oracle/instantclient_10_2/libsqora.so
/compat/linux/opt/oracle/instantclient_10_2/libsqora.so: error while loading shared libraries: /usr/local/lib/libodbcinst.so.1: ELF file OS ABI invalid
 
I removed it and reuse /compal/linux/sbin/ldconfig
Code:
$ ls -l /usr/local/lib | grep libodbcinst
-rw-r--r--   1 root  wheel    347918 Sep 14 15:29 libodbcinst.a
-rwxr-xr-x   1 root  wheel       953 Sep 14 15:29 libodbcinst.la
lrwxr-xr-x   1 root  wheel        20 Sep 14 15:29 libodbcinst.so -> libodbcinst.so.2.0.0
lrwxr-xr-x   1 root  wheel        16 Sep 20 14:13 libodbcinst.so.1 -> libodbcinst.so.2
lrwxr-xr-x   1 root  wheel        20 Sep 14 15:29 libodbcinst.so.2 -> libodbcinst.so.2.0.0
-rwxr-xr-x   1 root  wheel     98288 Sep 14 15:29 libodbcinst.so.2.0.0
Code:
$ /compat/linux/bin/bash /compat/linux/bin/ldd /compat/linux/opt/oracle/instantclient_10_2/libsqora.so
        ...
        libodbcinst.so.1 => not found
        ...
Code:
$ isql -v SR
ld-elf.so.1: /compat/linux/lib/libodbc.so.2: unsupported file layout
Now I'm trying to find the first version of this library.
 
i don't understand how it works - i have an FreeBSD version of unixODBC package and a linux oracle client with linux libraries for it. Should i resolve this dependensy?
Code:
$ /compat/linux/bin/bash /compat/linux/bin/ldd /compat/linux/opt/oracle/instantclient_10_2/libsqora.so
        linux-vdso.so.1 =>  (0x00007fffffffe000)
        libdl.so.2 => /compat/linux/lib64/libdl.so.2 (0x0000000801600000)
        libm.so.6 => /compat/linux/lib64/libm.so.6 (0x0000000801a00000)
        libpthread.so.0 => /compat/linux/lib64/libpthread.so.0 (0x0000000801e00000)
        libnsl.so.1 => /compat/linux/lib64/libnsl.so.1 (0x0000000802200000)
        libclntsh.so.10.1 => /compat/linux/opt/oracle/instantclient_10_2/libclntsh.so.10.1 (0x0000000802600000)
        libodbcinst.so.1 => not found
        libc.so.6 => /compat/linux/lib64/libc.so.6 (0x0000000803c00000)
        /lib64/ld-linux-x86-64.so.2 (0x0000000001021000)
        libnnz10.so => /compat/linux/opt/oracle/instantclient_10_2/libnnz10.so (0x0000000804000000)
When i try to connect to database:
Code:
$ /usr/local/bin/isql -v SR
ld-elf.so.1: /compat/linux/lib/libodbc.so.2: unsupported file layout
$ /compat/linux/bin/bash /compat/linux/bin/ldd /compat/linux/lib/libodbc.so.2
        linux-gate.so.1 =>  (0xffffd000)
        libltdl.so.7 => /compat/linux/lib/libltdl.so.7 (0x21094000)
        libdl.so.2 => /compat/linux/lib/libdl.so.2 (0x2109f000)
        libpthread.so.0 => /compat/linux/lib/libpthread.so.0 (0x210a4000)
        libc.so.6 => /compat/linux/lib/libc.so.6 (0x210c0000)
        /lib/ld-linux.so.2 (0x01001000)
if i do that
[root@SOMESERVER /compat/linux/opt/oracle/instantclient_10_2]# ln -s /compat/linux/lib64/libodbcinst.so.2.0.0 libodbcinst.so.1
i can use $ /compat/linux/bin/isql -v SR, but i need to use the FreeBSD isql version.
 
it is for zabbix monitoring, i have some legacy oracle databases and some mysql/postgres; by default zabbix server uses system unixODBC.
is it possible to use system unixODBC with linux oracle client, or i just fantasized it?
 
Top