LIBCLNTSH.SO: WRONG ELF CLASS: ELFCLASS32错误一例
生活随笔
收集整理的這篇文章主要介紹了
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
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 - macleansqlplus 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.13. 以上說明可能是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/lib324. 若檢查發現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.shWhere 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? SolutionDuring 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 directoriesThe 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 successfullyPlease see /tmp/changePerm_err.log for errors and /tmp/changePerm.log for the log of eventsThis 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错误一例的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: POI 2003/2007 下拉列表
- 下一篇: java文件操作大全