今天是2014-05-27,今天遇到一个lib问题,再次记录一下。这是一个案例,更是一种解决该问题的方法过程。

当我们在使用sqlplus 登陆unix数据库的时候,有可能出现类似:xxxxxx bad ELF interpreter: No such file or directory的问题。该问题的解决办法也是lib的问题。正常情况例如以下:

[root@dg1 ~]# su - oracle
[oracle@dg1 ~]$ ldd `which sqlplus`
linux-vdso.so.1 => (0x00007fff2e5ff000)
libsqlplus.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib/libsqlplus.so (0x00007fba1fef6000)
libclntsh.so.11.1 => /u01/app/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1 (0x00007fba1d48b000)
libnnz11.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib/libnnz11.so (0x00007fba1d0be000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003c93800000)
libm.so.6 => /lib64/libm.so.6 (0x0000003c94400000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003c94000000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003ca3000000)
libc.so.6 => /lib64/libc.so.6 (0x0000003c93c00000)
libaio.so.1 => /lib64/libaio.so.1 (0x00007fba1cea4000)
/lib64/ld-linux-x86-64.so.2 (0x0000003c93400000)
[oracle@dg1 ~]$

但有时候可能会缺失对应的lib文件。

那么对于该问题的解决思路是:

1、查看程序缺少的lib文件是那些

2、推断相应的lib文件时缺少还是环境变量问题。

3、假设是lib文件缺少那么须要安装相应的软件包或是复制相应的lib文件。假设是环境变量问题,那就须要更具不同系统设置不同的环境变量了。

另外对于oracle我们安装的32位的是lib32,是64位的那么是lib文件夹。

例如以下是我今天遇到的一个启动RealSync的样例,其它程序类似:

启动Realsync提演示样例如以下错误:

dsg@dg2 scripts]$ ./start
./start: /dsg/bin/archivelog: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
./start: /dsg/bin/archivelog: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
[dsg@dg2 scripts]$ ./stop
INFO: Stop realsync normally...
INFO: Stopping Vagentd ...
INFO: Stopping Loader -s for fullsync loader ...
INFO: Stopping Loader -r for realsync loader ...
[dsg@dg2 scripts]$
[dsg@dg2 scripts]$ exit

那么对于ld-linux.so.2是相应的glibc.i686这个包。因此进行安装:例如以下:

[root@dg2 ~]# cd /media/OL6.4\ x86_64\ Disc\ 1\ 20130225/Packages/
[root@dg2 Packages]# yum install glibc.i686
Loaded plugins: refresh-packagekit, security
oel6 | 3.7 kB 00:00 ...
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package glibc.i686 0:2.12-1.107.el6 will be installed
--> Processing Dependency: libfreebl3.so(NSSRAWHASH_3.12.3) for package: glibc-2.12-1.107.el6.i686
--> Processing Dependency: libfreebl3.so for package: glibc-2.12-1.107.el6.i686
--> Running transaction check
---> Package nss-softokn-freebl.i686 0:3.12.9-11.el6 will be installed
--> Finished Dependency Resolution Dependencies Resolved =======================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================
Installing:
glibc i686 2.12-1.107.el6 oel6 4.3 M
Installing for dependencies:
nss-softokn-freebl i686 3.12.9-11.el6 oel6 116 k Transaction Summary
=======================================================================================================================
Install 2 Package(s) Total download size: 4.4 M
Installed size: 13 M
Is this ok [y/N]: y
Downloading Packages:
-----------------------------------------------------------------------------------------------------------------------
Total 60 MB/s | 4.4 MB 00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : nss-softokn-freebl-3.12.9-11.el6.i686 1/2
Installing : glibc-2.12-1.107.el6.i686 2/2
Verifying : glibc-2.12-1.107.el6.i686 1/2
Verifying : nss-softokn-freebl-3.12.9-11.el6.i686 2/2 Installed:
glibc.i686 0:2.12-1.107.el6 Dependency Installed:
nss-softokn-freebl.i686 0:3.12.9-11.el6 Complete!
[root@dg2 Packages]# su - dsg
[dsg@dg2 bin]$ cd ../ ;cd scripts/;./start
dsg 4416 4391 0 11:48 pts/0 00:00:00 /dsg/bin/archivelog /dsg/log/log.vagentd /dsg/log/archivelog/log.vagentd_archlog 43200 5G
dsg 4426 4391 0 11:48 pts/0 00:00:00 /dsg/bin/archivelog /dsg/log/log.r0 /dsg/log/archivelog/log.r0_archlog 43200 5G
[dsg@dg2 scripts]$

这是没有错误提示,查看日志例如以下:

[dsg@dg2 log]$ tail -f log.vagentd
/dsg/bin/vagentd: error while loading shared libraries: libclntsh.so.11.1: wrong ELF class: ELFCLASS64
tail: log.vagentd: file truncated

查看该程序的使用lib信息:

[dsg@dg2 scripts]$ cd ../bin
[dsg@dg2 bin]$ ldd vagentd
linux-gate.so.1 => (0xf77a6000)
libclntsh.so.11.1 => not found
libnnz.so => not found
libpthread.so.0 => /lib/libpthread.so.0 (0xf7773000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xf7743000)
libdl.so.2 => /lib/libdl.so.2 (0xf773d000)
libm.so.6 => /lib/libm.so.6 (0xf7713000)
librt.so.1 => /lib/librt.so.1 (0xf770a000)
libc.so.6 => /lib/libc.so.6 (0x48cb8000)
/lib/ld-linux.so.2 (0x48c96000)
libfreebl3.so => /lib/libfreebl3.so (0xf76bb000)
[dsg@dg2 bin]$

能够知道眼下有两个问题,一个是libnnz.so没有,还有一个是libclntsh.so.11.1没有。须要做的是安装对应的软件包或是直接复制对应的lib文件到对应文件夹。

如今须要做的事是改动环境变量

[dsg@dg2 ~]$ more .bash_profile
# .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH
####ORACLE#######3333
export TMP=/tmp
export TMPDIR=/tmp
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=dg2
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
stty erase ^H
[dsg@dg2 ~]$ vi .bash_profile
# .bash_profile # Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi # User specific environment and startup programs PATH=$PATH:$HOME/bin export PATH
####ORACLE#######3333
export TMP=/tmp
export TMPDIR=/tmp
export ORACLE_BASE=/u01/app/oracle
export ORACLE_SID=dg2
export ORACLE_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
stty erase ^H
export LD_LIBRARY_PATH=$ORACLE_HOME/lib32:/u01/app/oracle/product/11.2.0/dbhome_1/lib32

再次查看该所需程序lib文件信息:

[dsg@dg2 bin]$ ldd vagentd
linux-gate.so.1 => (0xf77ef000)
libclntsh.so.11.1 => /u01/app/oracle/product/11.2.0/dbhome_1/lib32/libclntsh.so.11.1 (0xf5af0000)
libnnz.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib32/libnnz.so (0xf58a3000)
libpthread.so.0 => /lib/libpthread.so.0 (0xf5871000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xf5840000)
libdl.so.2 => /lib/libdl.so.2 (0xf583b000)
libm.so.6 => /lib/libm.so.6 (0xf5811000)
librt.so.1 => /lib/librt.so.1 (0xf5808000)
libc.so.6 => /lib/libc.so.6 (0x48cb8000)
libnnz11.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib32/libnnz11.so (0xf55ba000)
libnsl.so.1 => /lib/libnsl.so.1 (0xf559f000)
/lib/ld-linux.so.2 (0x48c96000)
libaio.so.1 => not found
libfreebl3.so => /lib/libfreebl3.so (0xf5550000)
[dsg@dg2 bin]$
那么须要安装libaio.so.1相应的软件包:
[root@dg2 Packages]# yum install libaio-
libaio-0.3.107-10.el6.i686.rpm libaio-0.3.107-10.el6.x86_64.rpm libaio-devel-0.3.107-10.el6.i686.rpm libaio-devel-0.3.107-10.el6.x86_64.rpm
[root@dg2 Packages]# yum install libaio-0.3.107-10.el6.i686.rpm
Loaded plugins: refresh-packagekit, security
Setting up Install Process
Examining libaio-0.3.107-10.el6.i686.rpm: libaio-0.3.107-10.el6.i686
Marking libaio-0.3.107-10.el6.i686.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package libaio.i686 0:0.3.107-10.el6 will be installed
--> Finished Dependency Resolution Dependencies Resolved =======================================================================================================================================================================
Package Arch Version Repository Size
=======================================================================================================================================================================
Installing:
libaio i686 0.3.107-10.el6 /libaio-0.3.107-10.el6.i686 31 k Transaction Summary
=======================================================================================================================================================================
Install 1 Package(s) Total size: 31 k
Installed size: 31 k
Is this ok [y/N]: Y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : libaio-0.3.107-10.el6.i686 1/1
Verifying : libaio-0.3.107-10.el6.i686 1/1 Installed:
libaio.i686 0:0.3.107-10.el6 Complete!
[root@dg2 Packages]#

再次查看:

[dsg@dg2 bin]$ ldd vagentd
linux-gate.so.1 => (0xf772c000)
libclntsh.so.11.1 => /u01/app/oracle/product/11.2.0/dbhome_1/lib32/libclntsh.so.11.1 (0xf5a2d000)
libnnz.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib32/libnnz.so (0xf57e0000)
libpthread.so.0 => /lib/libpthread.so.0 (0xf57ae000)
libcrypt.so.1 => /lib/libcrypt.so.1 (0xf577d000)
libdl.so.2 => /lib/libdl.so.2 (0xf5778000)
libm.so.6 => /lib/libm.so.6 (0xf574e000)
librt.so.1 => /lib/librt.so.1 (0xf5745000)
libc.so.6 => /lib/libc.so.6 (0x48cb8000)
libnnz11.so => /u01/app/oracle/product/11.2.0/dbhome_1/lib32/libnnz11.so (0xf54f7000)
libnsl.so.1 => /lib/libnsl.so.1 (0xf54dc000)
libaio.so.1 => /lib/libaio.so.1 (0xf54da000)
/lib/ld-linux.so.2 (0x48c96000)
libfreebl3.so => /lib/libfreebl3.so (0xf548b000)
[dsg@dg2 bin]$

启动RealSync:

[dsg@dg2 scripts]$ ./start
dsg 5203 1 0 12:04 pts/1 00:00:00 /dsg/bin/vagentd 50001
dsg 5204 5203 0 12:04 pts/1 00:00:00 /dsg/bin/vagentd 50001
dsg 5214 1 0 12:04 pts/1 00:00:00 /dsg/bin/loader -r -qno 0 1
dsg 5216 5214 0 12:04 pts/1 00:00:00 /dsg/bin/loader -r -qno 0 1
dsg 5213 1 0 12:04 pts/1 00:00:00 /dsg/bin/loader -s -qno 0 1
dsg 5215 5213 0 12:04 pts/1 00:00:00 /dsg/bin/loader -s -qno 0 1
dsg 5199 5174 0 12:04 pts/1 00:00:00 /dsg/bin/archivelog /dsg/log/log.vagentd /dsg/log/archivelog/log.vagentd_archlog 43200 5G
dsg 5208 5174 0 12:04 pts/1 00:00:00 /dsg/bin/archivelog /dsg/log/log.r0 /dsg/log/archivelog/log.r0_archlog 43200 5G
[dsg@dg2 scripts]$

至此问题得到解决:

oracle 库文件解决的方法 bad ELF interpreter: No such file or directory的更多相关文章

  1. 安装JDK出现错误:-bash: /usr/java/jdk1.7.0_71/bin/java: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory解决办法

    1.错误描述:安装好jdk之后,通过java -version,javac,java等命令测试是否安装成功时出现错误-bash: /usr/java/jdk1.7.0_71/bin/java: /li ...

  2. 解决/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory报错 (转)

    解决/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory报错 念淅 2020-01-03 15:02:25 3793 收 ...

  3. CentOS /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

    使用的时候出现一个错误 bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or direc ...

  4. /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory 错误:

    在安装tomcat时报了错: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory 本机环境: [root@AY1405 ...

  5. CentOS安装软件出现错误:bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

    CentOS安装软件出现错误: bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or d ...

  6. JDK1.3安装出现/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory Done.

    今天是出道以来第一次安装JDK1.3,大学的时候接触的也已是JDK1.4,而且是在Red Hat Enterprise Linux Server release 6.6上,安装JDK1.3是由于软件组 ...

  7. Symantec Backup Exec 2010 安装报 bad ELF interpreter: No such file or directory

    在64位的Red Hat Enterprise Linux Server release 6.6上安装Symantec Backup Exec 2010时, 遇到下面错误: # ./installra ...

  8. 修复/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory问题

    在配置MongDB的是时候出现这/lib/ld-linux.so.2问题 [root@localhost local]# /usr/local/mongodb/mongodb/bin/mongod - ...

  9. bad ELF interpreter: No such file or directory

    1.在64系统里执行32位程序如果出现/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory,安装下glic即可 yum ...

随机推荐

  1. UGUI 快捷键创建UGUI组件

      使用NGUI的时候还有xxx快捷键创建, spirte,label,button等等. 在UGUI里面的时候好像是没有快捷键的. 不知道以后多久才能有这个功能.  在家里闲无聊的时候写了一个脚本, ...

  2. C基础知识小总结(十)

                  "如有不正确之处,请指出,谢谢"    --Mood   <指针和函数> 指针函数   函数指针 <最基本的使用函数指针>   ...

  3. Linux经常使用命令大全

    系统信息  arch 显示机器的处理器架构(1)  uname -m 显示机器的处理器架构(2)  uname -r 显示正在使用的内核版本号  dmidecode -q 显示硬件系统部件 - (SM ...

  4. Hibernate PO对象的状态

    Hibernate的PO对象有三种状态:临时状态(又称临时态).持久状态(又称为持久态)和脱管状态(又称为脱管态.游离态).处理持久态的对象也称为PO,临时对象和脱管对象也称为VO. 1.临时态: 简 ...

  5. 阻止IOS自动识别页面上的电话号码、email地址

    之前写页面的时候碰到一个很恶心的情况,在6P上数字自动变色,后来找了一些资料: 在iOS的浏览器上,他们有时候会有一些“自作聪明”,自动把页面上的一串数字识别成电话号码,这样用户不小心点击这串数字,就 ...

  6. 【js】判断设备类型,访问相应的网站

    引入 function uaredirect(f) { try { if (document.getElementById("bdmark") != null) { return ...

  7. C++服务器设计(五):多设备类型及消息事件管理

    在传统的服务器系统中,服务器仅针对接收到的客户端消息进行解析,并处理后回复响应.在该过程中服务器并不会主动判断客户端类型.但在现实中,往往存在多种类型的客户端设备,比如物联网下的智能家居系统,就存在智 ...

  8. 跨平台渲染框架尝试 - GPU Buffer的管理(1)

    buffer资源 下面来谈谈buffer的管理.buffer资源从广义上就是C语言的数组.如下图所示. 图 buffer的广义模型 在渲染管线中,无论是opengl还是dx或者其他的渲染api,都会提 ...

  9. mysql数据库的连接

    public TJb checkjbByschool(long id)throws ClassNotFoundException,SQLException { Class.forName(" ...

  10. LinqToSql增加、修改、删除---(转载)

    LinqToSql ,EF:外键实体的CRD 2011-03-06 21:56:26|  分类: linq |  标签:编程  |字号 订阅           接触LinqTosql是很久的事情了, ...