Oracle

Oracle Linux核心上Oracle11.2g安裝後問題

  • April 5, 2017

在 Oracle Linux 核心上以靜默模式安裝 Oracle 11.2g 後,出現以下錯誤:

[u01/app/oracle/product/11/bin] $ sqlplus

sqlplus error while loading shared libraries: libsqlplus.so: cannot open shared  
object file: No such file or directory

但是,共享對像似乎設置正確:

[/u01/app/oracle/product/11/lib] $ ls -lrt /u01/app/oracle/product/11/lib | grep sqlplus  
-rw-r--r--. 1 oracle oinstall   1475820 Aug  1  2009 libsqlplus.a  
-rwxr-xr-x. 1 oracle oinstall   1218075 Aug  1  2009 libsqlplus.so

使用者是 oracle:

[oracle ~]$ id oracle  
uid=501(oracle) gid=501(oinstall) groups=501(oinstall),502(dba)

環境變數是:

[oracle ~]$ env  
USER=oracle  
LD_LIBRARY_PATH=/u01/app/oracle/product/11/lib  
ORACLE_SID=orcl  
ORACLE_BASE=/u01/app/oracle      
PATH=/usr/lib/qt-3.3/bin:/usr/local/bin
   :/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin: /home/oracle/bin
   :/u01/app/oracle/product/11/bin  
HOME=/home/oracle  
ORACLE_HOME=/u01/app/oracle/product/11  

核心版本:

2.6.32-300.3.1.el6uek.i686

更新答案

[oracle@orcus lib]$ ldd /u01/app/oracle/product/11/bin/sqlplus   
   linux-gate.so.1 =>  (0xb771f000)  
   libsqlplus.so => /u01/app/oracle/product/11/lib/libsqlplus.so (0xb766e000)  
libclntsh.so.11.1 => not found  
   libnnz11.so => /u01/app/oracle/product/11/lib/libnnz11.so (0xb7415000)  
   libdl.so.2 => /lib/libdl.so.2 (0x4c5dc000)  
   libm.so.6 => /lib/libm.so.6 (0x4c616000)  
   libpthread.so.0 => /lib/libpthread.so.0 (0x4c5e3000)  
   libnsl.so.1 => /lib/libnsl.so.1 (0x4caef000)  
   libc.so.6 => /lib/libc.so.6 (0x4c44a000)  
   /lib/ld-linux.so.2 (0x4c424000)  
   libclntsh.so.11.1 => not found   

*** 在 chmod /u01/app/oracle/product/11/lib/libclntsh 之後* ***

$ ldd /u01/app/oracle/product/11/bin/sqlplus   
   linux-gate.so.1 =>  (0xb7831000)  
   libsqlplus.so => /u01/app/oracle/product/11/lib/libsqlplus.so (0xb7780000)  
   libclntsh.so.11.1 => /u01/app/oracle/product/11/lib/libclntsh.so.11.1 (0xb5a7b000)  
   libnnz11.so => /u01/app/oracle/product/11/lib/libnnz11.so (0xb582e000)  
   libdl.so.2 => /lib/libdl.so.2 (0x4c5dc000)  
   libm.so.6 => /lib/libm.so.6 (0x4c616000)  
   libpthread.so.0 => /lib/libpthread.so.0 (0x4c5e3000)  
   libnsl.so.1 => /lib/libnsl.so.1 (0x4caef000)  
   libc.so.6 => /lib/libc.so.6 (0x4c44a000)  
   libaio.so.1 => /lib/libaio.so.1 (0x4c446000)  
/lib/ld-linux.so.2 (0x4c424000)  

知道為什麼 SQLPlus 抱怨libsqlplus.so嗎?

使 libclntsh 可執行:

chmod +rx /u01/app/oracle/product/11/lib/libclntsh*

然後再次檢查上面註釋的 ldd 命令。

您應該在 /u01/app/oracle/product/11/lib 中搜尋 libclntsh.so.11.1 ,

引用自:https://dba.stackexchange.com/questions/12005