linux – [01000] [unixodBC] [Driver Manager]无法打开lib’/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so’:找不到文件

前端之家收集整理的这篇文章主要介绍了linux – [01000] [unixodBC] [Driver Manager]无法打开lib’/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so’:找不到文件前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我试图从 linux服务器访问oracle.我正在使用unixODBC.

当我尝试访问oracle使用isql和我得到错误,驱动程序管理器无法打开libsqora.so.12.1.

ODBC.INI

[NAME]
 Application Attributes = T
 Attributes = W
 BatchAutocommitMode = IfAllSuccessful
 BindAsFLOAT = F
 CloseCursor = F
 DisableDPM = F
 DisableMTS = T
 Driver = Oracle 11g ODBC driver
 DSN = DSN_NAME
 EXECSchemaOpt =
 EXECSyntax = T
 Failover = T
 FailoverDelay = 10
 FailoverRetryCount = 10
 FetchBufferSize = 64000
 ForceWCHAR = F
 Lobs = T
 Longs = T
 MaxLargeData = 0
 MetadataIdDefault = F
 QueryTimeout = T
 ResultSets = T
 ServerName = ServerName
 sqlGetData extensions = F
 Translation DLL =
 Translation Option = 0
 DisableRULEHint = T
 UserID = xxxx
 Password=<password>
 StatementCache=F
 CacheBufferSize=20
 USEOCIDescribeAny=F

ODBCINST.INI

[Oracle 11g ODBC driver]
 Description=Oracle ODBC driver for Oracle 11g
 Driver=/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so
 FileUsage=1

然后,当我使用isql来访问oracle我得到以下错误

[root@xxxxx lib]# isql -v NAME
 [01000][unixODBC][Driver Manager]Can't open lib '/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so' : file not found
 [Isql]ERROR: Could not sqlConnect

我在odbcinst.ini中输错了.我已经纠正但仍然相同的错误.

[root@xxxxx tmp]# isql -v NAME
 [01000][unixODBC][Driver Manager]Can't open lib '/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so.11.1' : file not found
 [Isql]ERROR: Could not sqlConnect


 [root@xxxxx tmp]# ls -l /usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so.11.1
 -rw-r--r-- 1 bin bin 996363 Sep  5  2010 /usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so.11.1

 [Oracle 11g ODBC driver]
  Description=Oracle ODBC driver for Oracle 11g
  Driver=/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so.11.1
  FileUsage=1

ENV

[root@xxxxx tmp]# env
 HOSTNAME=xxxxx
 SSH2_TTY=/dev/pts/0
 SHELL=/bin/bash
 TERM=xterm
 HISTSIZE=1000
 ODBC_DIR=/usr/local/easysoft/unixODBC
 OLDPWD=/usr/local/easysoft
 SSH_SESSION_ID=1424
 SSH_TTY=/dev/pts/0
 LD_LIBRARY_PATH=/usr/local/easysoft/lib:/usr/local/easysoft/unixODBC/lib
 A__z="*SHLVL
 TNS_ADMIN=/usr/local/easysoft/oracle/InstantClient112/network/
 INPUTRC=/etc/inputrc
 PWD=/tmp
 LANG=en_US.UTF-8
 ODBCSYSINI=/etc/
 HOME=/root
 SHLVL=3
 ODBCINI=/etc
 LESSOPEN=|/usr/bin/lesspipe.sh %s
 ORACLE_HOME=/usr/local/easysoft/oracle/InstantClient112/
 G_BROKEN_FILENAMES=1
 _=/bin/env

 PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/easysoft/unixODBC/bin:/opt/oraClient/11.2.0.4/bin

修复LD_LIBRARY_PATH更新的原始问题,但现在重新打破,因为我试图使用32位Oracle客户端.

在目录/opt/oraClient/11.2.0.4_32/中安装32位oracle客户端.

修改了odbcinst.ini:

[Oracle 11g ODBC driver]
Description=Oracle ODBC driver for Oracle 11g
#Driver=/usr/local/easysoft/oracle/InstantClient112/lib/libsqora.so.11.1
Driver=/opt/oraClient/11.2.0.4_32/lib/libsqora.so.11.1
FileUsage=1

错误

[root@xxxxx lib]# /usr/local/bin/isql -v NAME                                                      
 [01000][unixODBC]  [Driver Manager]Can't open lib '/opt/oraClient/11.2.0.4_32/lib/libsqora.so.11.1' : file not found
 [Isql]ERROR: Could not sqlConnect

如果我需要使用32位Oracle客户端,我做错了什么…我知道这是环境变量.

[root@xxxxx lib]# file /opt/oraClient/11.2.0.4_32/lib/libsqora.so.11.1
 /opt/oraClient/11.2.0.4_32/lib/libsqora.so.11.1: ELF 32-bit LSB shared object,Intel 80386,version 1 (SYSV),not stripped

我启用跟踪,但我无法在这里附加文档.我可以发电子邮件

更多调试信息:

[root@xxxxx bin]# ldd /opt/oraClient/11.2.0.4_32/lib/libsqora.so.11.1
 ldd: warning: you do not have execution permission for `/opt/oraClient/11.2.0.4_32/lib/libsqora.so.11.1'
    linux-gate.so.1 =>  (0xffffe000)
    libdl.so.2 => /lib/libdl.so.2 (0xf7f2b000)
    libm.so.6 => /lib/libm.so.6 (0xf7f02000)
    libpthread.so.0 => /lib/libpthread.so.0 (0xf7ee8000)
    libnsl.so.1 => /lib/libnsl.so.1 (0xf7ecf000)
    libclntsh.so.11.1 => not found
    libodbcinst.so.1 => not found
    libc.so.6 => /lib/libc.so.6 (0xf7d71000)
    /lib/ld-linux.so.2 (0x00134000)

我没有得到一个可能导致一些问题的“未找到”

[root@xxxxx bin]# ls /opt/oraClient/11.2.0.4_32/lib/libclntsh.so.11.1
 /opt/oraClient/11.2.0.4_32/lib/libclntsh.so.11.1

以下是最新的env输出

[root@xxxxx]# env
  HOSTNAME=xxxxx
  SSH2_TTY=/dev/pts/0
  TERM=xterm
  SHELL=/bin/bash
  HISTSIZE=1000
  ODBC_DIR=/usr/local/easysoft/unixODBC
  SSH_TTY=/dev/pts/0
        LD_LIBRARY_PATH=/opt/oraClient/11.2.0.4_32/:/opt/oraClient/11.2.0.4_32/lib/:/usr/local/easysoft/oracle/InstantClient112:/usr/local/easysoft/oracle/InstantClient112/lib/
  TNS_ADMIN=/opt/oraClient/11.2.0.4_32/network/
  PATH=/usr/kerberos/sbin:/usr/kerberos/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/easysoft/unixODBC/bin:/opt/oraClient/11.2.0.4_32/bin
  INPUTRC=/etc/inputrc
  LANG=en_US.UTF-8
  ODBCSYSINI=/etc/
  SHLVL=4
  HOME=/root
  ODBCINI=/etc
  ORACLE_HOME=/opt/oraClient/11.2.0.4_32/
  G_BROKEN_FILENAMES=1
  _=/bin/env

解决方法

这个错误是误导性的:
The file that the error claimed was not present did exist.

我能通过执行以下命令来追踪实际丢失的文件

# ldd /path/to/your/socalled/missing/file.so

这返回一系列文件,一个说:

libodbcinst.so.2 => not found

那是我的罪魁祸首.然后,我创建了我需要的链接,瞧,错误消失了.

参考:http://mailman.unixodbc.org/pipermail/unixodbc-support/2011-November/003018.html

原文链接:https://www.f2er.com/linux/393521.html

猜你在找的Linux相关文章