Forum Stats

  • 3,733,800 Users
  • 2,246,821 Discussions
  • 7,856,877 Comments

Discussions

isql | unixODBC | Driver Manager can't open lib "libsqora.so.12.1"

DanielHP
DanielHP Member Posts: 22
edited October 2013 in Heterogeneous Connectivity

hi all...

i try to acces oracle from postgre..

i use ODBC..

first i try to acces oracle from isql and i got error that driver manager can't open libsqora.so.12.1

this is my configuration

odbc.ini

[XE]
Description     = Oracle ODBC
Driver          = XE
Trace           = yes
TraceFile       = /tmp/odbc_oracle.log
Database        = //192.168.102.202:1521/XE
UserID          = system
Password        = password
Port            = 1521


odbcinst.ini

[XE]
Description = Oracle ODBC Connection Driver
Driver      = root/download/odbc/instantclient_12_1/libsqora.so.12.1
Debug       = 0
CommLog     = 1


tnsname.ora

XE =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.102.202)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = XE)
    )
  )


then, when i use isql to acces oracle i got that error:

[[email protected] ~]# isql -v XE
[01000][unixODBC][Driver Manager]Can't open lib 'root/download/odbc/instantclient_12_1/libsqora.so.12.1' : file not found
[ISQL]ERROR: Could not SQLConnect


whats wrong with my configuration, can anyone help me??

thanks,

Daniel

Tagged:

Answers

  • Kgronau-Oracle
    Kgronau-Oracle Posts: 2,550 Employee

    Isn't there a slash missing right at the beginning of the path of the ODBC driver location?

    Check "ls -al root/download/odbc/instantclient_12_1/libsqora.so.12.1" and report its result.

    Btw, when you want to access Postgres from Oracle you do not need an Oracle ODBC driver.

    - Klaus

  • DanielHP
    DanielHP Member Posts: 22
    edited October 2013

    dear kgronau,

    this is the result of "ls -al linsqora.so.12.1"

    [[email protected] instantclient_12_1]# ls -al libsqora.so.12.1
    -rwxrwxrwx 1 root root 3303791 May 27 14:49 libsqora.so.12.1
    
    

    i tried use ldd for libsqora and had this result

    [[email protected] instantclient_12_1]# ldd -v libsqora.so.12.1
            linux-gate.so.1 =>  (0x00b4e000)
            libdl.so.2 => /lib/libdl.so.2 (0x006f8000)
            libm.so.6 => /lib/libm.so.6 (0x00b1f000)
            libpthread.so.0 => /lib/libpthread.so.0 (0x00829000)
            libnsl.so.1 => /lib/libnsl.so.1 (0x008d4000)
            librt.so.1 => /lib/librt.so.1 (0x009cd000)
            libclntsh.so.12.1 => /usr/lib/libclntsh.so.12.1 (0xf5628000)
            libodbcinst.so.2 => not found
            libc.so.6 => /lib/libc.so.6 (0x00110000)
            /lib/ld-linux.so.2 (0x00f73000)
            libnnz12.so => /usr/lib/libnnz12.so (0x00f93000)
            libons.so => /usr/lib/libons.so (0x00484000)
            libaio.so.1 => not found
            libclntshcore.so.12.1 => not found
            libclntshcore.so.12.1 => not found
    
    
            Version information:
            ./libsqora.so.12.1:
                    librt.so.1 (GLIBC_2.2) => /lib/librt.so.1
                    libdl.so.2 (GLIBC_2.0) => /lib/libdl.so.2
                    libdl.so.2 (GLIBC_2.1) => /lib/libdl.so.2
                    libm.so.6 (GLIBC_2.0) => /lib/libm.so.6
                    libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                    libpthread.so.0 (GLIBC_2.2) => /lib/libpthread.so.0
                    libpthread.so.0 (GLIBC_2.1) => /lib/libpthread.so.0
                    libpthread.so.0 (GLIBC_2.0) => /lib/libpthread.so.0
                    libpthread.so.0 (GLIBC_2.3.2) => /lib/libpthread.so.0
            /lib/libdl.so.2:
                    ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
                    libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
                    libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
            /lib/libm.so.6:
                    ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
                    libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
            /lib/libpthread.so.0:
                    ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
                    ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
                    ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
                    libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
                    libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
            /lib/libnsl.so.1:
                    libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.2.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
            /lib/librt.so.1:
                    libpthread.so.0 (GLIBC_2.1) => /lib/libpthread.so.0
                    libpthread.so.0 (GLIBC_2.2) => /lib/libpthread.so.0
                    libpthread.so.0 (GLIBC_PRIVATE) => /lib/libpthread.so.0
                    libpthread.so.0 (GLIBC_2.0) => /lib/libpthread.so.0
                    libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
                    libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
            /usr/lib/libclntsh.so.12.1:
                    libdl.so.2 (GLIBC_2.0) => /lib/libdl.so.2
                    libdl.so.2 (GLIBC_2.3.3) => /lib/libdl.so.2
                    libdl.so.2 (GLIBC_2.1) => /lib/libdl.so.2
                    libm.so.6 (GLIBC_2.1) => /lib/libm.so.6
                    libm.so.6 (GLIBC_2.0) => /lib/libm.so.6
                    libc.so.6 (GLIBC_2.1.2) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.3.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
                    libaio.so.1 (LIBAIO_0.4) => not found
                    libaio.so.1 (LIBAIO_0.1) => not found
                    libpthread.so.0 (GLIBC_2.2) => /lib/libpthread.so.0
                    libpthread.so.0 (GLIBC_2.1) => /lib/libpthread.so.0
                    libpthread.so.0 (GLIBC_2.0) => /lib/libpthread.so.0
                    libpthread.so.0 (GLIBC_2.3.2) => /lib/libpthread.so.0
            /lib/libc.so.6:
                    ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
                    ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
                    ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
            /usr/lib/libnnz12.so:
                    libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.1.2) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
            /usr/lib/libons.so:
                    libpthread.so.0 (GLIBC_2.1) => /lib/libpthread.so.0
                    libpthread.so.0 (GLIBC_2.3.2) => /lib/libpthread.so.0
                    libpthread.so.0 (GLIBC_2.0) => /lib/libpthread.so.0
                    libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.3) => /lib/libc.so.6
                    libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
    
    

    libodbcinst.so.2 => not found (i had copy that to lib but still not found)

    libaio.so.1 => not found

    libclntshcore.so.12.1 => not found

    libclntshcore.so.12.1 => not found

    i try to copy many file to lib and still nit found, whats wrong??

    thanks,

    Daniel

  • Kgronau-Oracle
    Kgronau-Oracle Posts: 2,550 Employee

    Daniel,

    did you check it using "ls -al root/download/odbc/instantclient_12_1/libsqora.so.12.1"?

    For me it looks like you're missing the slash at the beginning and the correct path should be "/root/download/odbc/instantclient_12_1/libsqora.so.12.1".

    What ODBC Driver version did you install (odbcinst -j)?

    libaio.so is commonly installed in /usr/lib64/ part of the libaio package.

    And libclnt is the Oracle client library. So make sure you have correctly set the LD_LIBRARY_PATH.

    - Klaus

  • DanielHP
    DanielHP Member Posts: 22

    Dear Klaus,

    - yes, i checked root/download/odbc/instantclient_12_1/libsqora.so.12.1

    - i used slash still can't open libsqora.so

    - i installed ODBC 2.3.1

    - i founded libaio.so at /usr/lib64 but still not found in ldd

    - i set LD_LIBRARY_PATH at :

    ]$ echo $LD_LIBRARY_PATH
    /usr/lib:/usr/lib64:/lib:
    

    Thanks,

    Daniel

  • Kgronau-Oracle
    Kgronau-Oracle Posts: 2,550 Employee

    please post the output of the "env" and "ls -al /root/download/odbc/instantclient_12_1/libsqora.so.12.1" command and then right afterwards call again "isql -v XE".

    Please post the output for all 3 commands.

  • DanielHP
    DanielHP Member Posts: 22

    this the result

    env

    [[email protected] ~]# env
    HOSTNAME=oracle-poc
    TERM=xterm
    SHELL=/bin/bash
    HISTSIZE=1000
    NLS_LANG=AMERICAN_AMERICA.AL32UTF8
    SSH_CLIENT=10.0.1.148 59210 22
    OLDPWD=/root
    SSH_TTY=/dev/pts/2
    USER=root
    LD_LIBRARY_PATH=/usr/lib:/usr/lib64
    LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=01;05;37;41:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.dz=01;31:*.gz=01;31:*.lz=01;31:*.xz=01;31:*.bz2=01;31:*.tbz=01;31:*.tbz2=01;31:*.bz=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.rar=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.axv=01;35:*.anx=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=01;36:*.au=01;36:*.flac=01;36:*.mid=01;36:*.midi=01;36:*.mka=01;36:*.mp3=01;36:*.mpc=01;36:*.ogg=01;36:*.ra=01;36:*.wav=01;36:*.axa=01;36:*.oga=01;36:*.spx=01;36:*.xspf=01;36:
    ORACLE_SID=XE
    MAIL=/var/spool/mail/root
    PATH=/u01/app/oracle/product/11.2.0/xe/bin:/u01/app/oracle/product/11.2.0/xe/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin:/sbin:/bin:/root/bin
    PWD=/root
    LANG=en_US.UTF-8
    HISTCONTROL=ignoredups
    SHLVL=1
    HOME=/root
    LOGNAME=root
    SSH_CONNECTION=10.0.1.148 59210 192.168.102.202 22
    LESSOPEN=|/usr/bin/lesspipe.sh %s
    ORACLE_HOME=/u01/app/oracle/product/11.2.0/xe
    G_BROKEN_FILENAMES=1
    _=/bin/env
    

    ls -al /root/download/odbc/instantclient_12_1/libsqora.so.12.1

    [[email protected] ~]# ls -al /root/download/odbc/instantclient_12_1/libsqora.so.12.1
    -rwxrwxrwx 1 root root 3303791 May 27 14:49 /root/download/odbc/instantclient_12_1/libsqora.so.12.1
    

    isql -v XE

    [[email protected] ~]# isql -v XE
    [01000][unixODBC][Driver Manager]Can't open lib '/root/download/odbc/instantclient_12_1/libsqora.so.12.1' : file not found
    [ISQL]ERROR: Could not SQLConnect
    

    thanks,

    Daniel

  • Kgronau-Oracle
    Kgronau-Oracle Posts: 2,550 Employee

    No ODBCINI variable is set. In addition you have set your LD_LIBRARY_PATH to LD_LIBRARY_PATH=/usr/lib:/usr/lib64 - but it misses the Oracle ODBC driver directory as well as the Oracle client library directory.

    Btw, why do you want to investigate into the Oracle ODBC driver issue when your real aim is to connect from Oracle to a Postgres database? Wouldn't it make sense to install the Postgres ODBC driver instead and to check if the driver can connect?

    - Klaus

  • DanielHP
    DanielHP Member Posts: 22

    i think before i use Postgres ODBC i should connecting to Oracle from isql..

    and when used postgres to connect was unsucces

    postgres=# select odbclink.connect('DSN=XE');
    ERROR:  odbclink: unsuccessful SQLConnect call: [IM002] [0] [[unixODBC][Driver Manager]Data source name not found, and no default driver specified]
    
  • Kgronau-Oracle
    Kgronau-Oracle Posts: 2,550 Employee

    sorry, I didn't read the first update carefully enough or got side tracked as you posted it in the heterogeneous services forum. You want to connect from Postgres to Oracle and hence you need the Oracle ODBC driver.

    The Oracle ODBC driver requires the Oracle client libs. So make sure to add them to the LD_LIBRARY_PATH

  • DanielHP
    DanielHP Member Posts: 22

    yes thats right i try to use postgre db link to acces oracle database

    i add oracle clients libs to LD_LIBRARY_PATH but still can't open libsqora..

    thanks,

    Daniel

  • Kgronau-Oracle
    Kgronau-Oracle Posts: 2,550 Employee

    let's use strace and create a diag trace (isql.log)  file - please do NOT post it in the thread, instead upload it to a public file share like dropbox and provide its link.

    strace -fae -o isql.log isql -v XE

  • DanielHP
    DanielHP Member Posts: 22
  • Kgronau-Oracle
    Kgronau-Oracle Posts: 2,550 Employee

    Everything in the strace file looks like a wrong LD_LIBRARY_PATH setting where the location of the Oracle client lib (for example libclntsh.so.12.1) is missing.

    You mentioned above that you have set it, but got the same error.

    1. Where is your libclntsh.so.12.1 library located?

    2. Can you please again make sure the correct LD_LIBRARY_PATH is set and post the env setting as well as the isql output and a link to another, new isql.log file?

This discussion has been closed.