http://www.oracledatabase12g.com/archives/libclntsh-so-wrong-elf-class-elfclass32%E9%94%99%E8%AF%AF%E4%B8%80%E4%BE%8B.html

LIBCLNTSH.SO: WRONG ELF CLASS: ELFCLASS32错误一例

作者: Maclean Liu , post on September 8th, 2011 , English Version
【本站文章除注明转载外,均为本站原创编译】
转载请注明:文章转载自: Oracle Clinic – Maclean Liu的个人技术博客 [http://www.oracledatabase12g.com/]
本文标题: LIBCLNTSH.SO: WRONG ELF CLASS: ELFCLASS32错误一例
本文永久地址: http://www.oracledatabase12g.com/archives/libclntsh-so-wrong-elf-class-elfclass32%e9%94%99%e8%af%af%e4%b8%80%e4%be%8b.html

某套数据库以dba组用户登录正常,但以非dba组用户登录时出现LIBCLNTSH.SO: WRONG ELF CLASS: ELFCLASS32错误,如下例子:

su  - maclean
sqlplus
ld.so.1: sqlplus: fatal: /s01/orabase/product/10.2.0/dbhome_1/lib32/libclntsh.so.10.1 : wrong ELF class:  ELFCLASS32

这里可以看到引起wrong ELF class的库文件(libclntsh.so.10.1)位于lib32目录下,说明该库文件是32位的。

一般来说只有安装了64位oracle软件时会同时出现lib和lib32 这2个存放库文件的目录, 当安装了32位oracle软件时则只会显示lib一个目录。 这也是判断所安装的Oracle数据库软件是64 bit 还是 32 bit的一种方法。

以上问题一般是由于设置了不正确的LD_LIBRARY_PATH 环境变量 , 或者 lib 目录、libclntsh.so.10.1权限不正确引起的。

建议通过以下步骤排查问题:

1. 检查 sqlplus 命令相关的so共享库文件
[oracle@vrh1 ~]$ ldd `which sqlplus`
linux-vdso.so.1 =>  (0x00007fff0bbfd000)
libsqlplus.so => /s01/orabase/product/10.2.0/dbhome_1/lib/libsqlplus.so (0x00002b450f6b4000)
libclntsh.so.10.1 => /s01/orabase/product/10.2.0/dbhome_1/lib/libclntsh.so.10.1 (0x00002b450f89b000)
libnnz10.so => /s01/orabase/product/10.2.0/dbhome_1/lib/libnnz10.so (0x00002b4510ec6000)
libdl.so.2 => /lib64/libdl.so.2 (0x0000003635c00000)
libm.so.6 => /lib64/libm.so.6 (0x0000003635800000)
libpthread.so.0 => /lib64/libpthread.so.0 (0x0000003636000000)
libnsl.so.1 => /lib64/libnsl.so.1 (0x0000003639800000)
libc.so.6 => /lib64/libc.so.6 (0x0000003635400000)
libaio.so.1 => /usr/lib64/libaio.so.1 (0x00002b45122ab000)
/lib64/ld-linux-x86-64.so.2 (0x0000003635000000)
2. 找出以上输出中与所报错误中文件名相符的记录,如错误中所报的so文件的路径名为
/s01/orabase/product/10.2.0/dbhome_1/lib32/libclntsh.so.10.1
而 64位 sqlplus 所需要的64位 so文件 的路径为
/s01/orabase/product/10.2.0/dbhome_1/lib/libclntsh.so.10.1
3. 以上说明可能是LD_LIBRARY_PATH 变量存在问题 , 检查该变量
echo $LD_LIBRARY_PATH
/s01/orabase/product/10.2.0/dbhome_1/lib32:/s01/orabase/product/10.2.0/dbhome_1/lib
一般来说在64位的情况下 需要将 lib 目录 放置在 该LD_LIBRARY_PATH 变量的前面,如
export LD_LIBRARY_PATH= $ORACLE_HOME/lib:$ORACLE_HOME/lib32
4. 若检查发现LD_LIBRARY_PATH 变量没有问题, 那么可以进一步检查 lib 和lib32 这2个目录的权限 ,以及相关so 文件是否对 other组有必要的r-x权限。
也可以通过9.2.0.8 和 10g中自带的 changePerm.sh脚本来修复问题,该脚本一般位于$ORACLE_HOME/install目录下
su  - oracle
$ cd $ORACLE_HOME/install
$ ./changePerm.sh
Where is the script changePerm.sh?
Applies to:
Oracle Server - Enterprise Edition - Version: 9.2.0.8 to 10.2.0.5.0 - Release: 9.2 to 10.2
Information in this document applies to any platform.
Goal
Where is the script changePerm.sh?
Solution
During patch set installation, all new files and directories are created with restricted access,
by default. Users or third party applications with a different group identifier from that of the database,
which try to access client-side utilities or libraries in the database home,
will see permission errors when trying to access these files or directories.
changePerm.sh is a script that allows users that do not belong to the database group to
access and execute files in the ORACLE_HOME directory. Only run this script when absolutely
required as it will reduce security. The script (borne shell) loops through a hard-coded set of
files and directories, extracts the "group" permissions, and set the "other" permissions the
same as the group's permissions. By doing so, "other" users are able to execute
these files and change to these directories
The script is located in the ORACLE_HOME/install directory on Unix and Linux systems
(there is no equivalent for Windows).
This script ships with Oracle Database versions 9.2.0.8 and Oracle 10g releases.
The changePerm.sh file is not available nor necessary for Oracle Database Server 11.1
and above because in 11g,
permissions under the Oracle Home (including "others") are set correctly/relaxed.
Output when the changePerm.sh script is executed:
$ cd $ORACLE_HOME/install
$ ./changePerm.sh
-------------------------------------------------------------------------------
Disclaimer: The purpose of this script is to relax permissions on some of the
files in the database Oracle Home so that all clients can access them.
Please note that Oracle Corporation recommends using the most restrictive file
permissions as possible for your given implementation. Running this script
should be done only after considering all security ramifications.
-------------------------------------------------------------------------------
Do you wish to continue (y/n) : y
Finished running the script successfully
Please see /tmp/changePerm_err.log for errors and /tmp/changePerm.log for the log of events
This script should be run by Oracle Software owner to relax the permission
and can be run while database processes are active.
Note :
1. If you are patching Oracle RAC home, then you will need to run this script on all the nodes
2. Oracle recommends using the most restrictive file permissions
possible for your given implementation. Run this script only after considering
all security ramifications and only if you need to share this installation

LIBCLNTSH.SO: WRONG ELF CLASS: ELFCLASS32错误一例相关推荐

  1. [linux数据库]error while loading shared libraries: libnsl.so.1: wrong ELF class: ELFCLASS32

    解决error while loading shared libraries: libnsl.so.1: wrong ELF class: ELFCLASS32 数据库位数不匹配问题 问题 解决方案 ...

  2. 又遇到问题:wrong ELF class: ELFCLASS32 in Unknown on line

    上传到真正的服务器上,发现服务器用的是64位系统,当时就真的应该想到这一点! 出现了wrong ELF class: ELFCLASS32 in Unknown on line这种好像是32位程序与6 ...

  3. ORA-00600错误一例

    ORA-00600错误一例,一个SQL运行时报ORA-00600的错误. 英文错误信息: ORA-00600: internal error code, arguments: [qkeAddDepen ...

  4. wrong ELF class: ELFCLASS32

    手动安装 libstdc+±4.8.5-44.el7.i686.rpm之后报错: 解决:重新安装64位的rpm包,因为系统是64位的(64位应该兼容32位的才对啊)

  5. incremental backup恢复错误一例

    incremental backup恢复归档GAP的DG的方法本文不再详述,可参照链接:http://yunlongzheng.blog.51cto.com/788996/717249 本文着重讲一次 ...

  6. 0x80070002错误一例

    这几天在准备在Windows Server 2008 R2上安装WSUS服务,之前在一台虚拟机上测试过,通过理控制台中添加角色是可以正常安装的,没想到这两天开始在服务器管理器里添加角色就怎么也无法安装 ...

  7. ORA-00600 [4400][48]错误一例

    5月26日某客户告警日志中出现的ORA-00600 [4400],[48]错误记录,并产生了trace文件:, *** SERVICE NAME:(ETL) 2010-05-26 16:45:45.9 ...

  8. SharePoint 2007 用户创建 MySite 过程发生错误一例【已解决】

    用户在创建MySite时遇到如下错误并报告上来,下面为错误截图. 错误信息:There has been an error creating the personal site. Contact yo ...

  9. 解决Redis服务错误一例听语音

    Redis是很有效的一项服务,但是初学者会碰到很多问题,我希望这篇文章能够帮助到他们. 在运行Redis服务后,几分钟后抛出一个错误: Failed Opening .rdb for saving:P ...

最新文章

  1. [转] android 中 pinyin4j的使用
  2. 更新版-梳理前端开发使用eslint和prettier来检查和格式化代码问题
  3. Cisco 交换机配置端口镜像
  4. 递归第一弹:初步理解
  5. ubuntu server 10.04 NFS 添加共享目录
  6. DotText使用非80端口(默认端口)时URL出错
  7. linux-使用xshell连接linux教程
  8. 2个表 遍历 组合_7.2 图的存储结构(2)
  9. 2015年第六届蓝桥杯国赛试题(JavaA组)
  10. Ubuntu下emacs使用搜狗输入法
  11. POI 操作 Excel
  12. (转)全球最权威人脸识别测试PK
  13. 经典c语言笔试题及答案,C语言经典笔试题
  14. 一个将汉字转换成拼音的npm包
  15. MyEclipse10安装破解教程
  16. ModelCoder模块系列:PID模块介绍
  17. Latex语法学习02:文本悬挂缩进
  18. 一步一步教你使用云服务器部署爬虫
  19. Android 朋友圈之多图显示
  20. 浅谈什么是web应用防火墙(WAF)

热门文章

  1. 将SQL文件导入Hive
  2. C++经典面试题(最全,面中率最高)
  3. 【机器视觉】 endwhile算子
  4. 【STM32】FreeRTOS创建和删除任务示例(动态方法)
  5. 【STM32】FSMC概述
  6. android天女散花效果_Android有趣的爆炸散落动画view:开源ExplosionField
  7. windos oracle创建sid,window下改oracle_sid | 学步园
  8. java stw_JVM STW里的no vm operation是怎么发生的
  9. DocKer linux Centos 安装DocKer 只需要十步
  10. 字符串常量前面的L的作用