錯誤 error while loading shared libraries: libclntsh.so.9.0 的解決
上午一個同事在安裝客戶端後,出現了問題,錯誤提示資訊如下:
[oracle@filesvr1 bin]$ ./sqlplus /nolog
./sqlplus: error while loading shared libraries: libclntsh.so.9.0: cannot open shared object file: No such file or directory
具體情況如下:
業務伺服器由於硬體原因,需要更換一臺伺服器,在新伺服器上同樣要安裝Oracle 9i客戶端。 由於新伺服器和舊伺服器的linux版本相同,所以考慮將老伺服器上的Oracle客戶端直接copy到新伺服器上即可:
[oracle@filesvr1 oracle]$ scp -pr oracle@172.16.3.85:/opt/oracle/product ./
oracle@172.16.3.85's password:
root.sh 100% 10 30.5KB/s 00:00
areasQueries.jar 100% 52KB 5.0MB/s 00:00
generalQueries.jar 100% 72KB 8.0MB/s 00:00
rgsQueries.jar 100% 54KB 8.5MB/s 00:00
globalVarQueries.jar 100% 6707 2.0MB/s 00:00
SpawnQueries.jar 100% 10KB 3.5MB/s 00:00
SidQueries.jar 100% 57KB 7.6MB/s 00:00
RunningProcessesQuery.jar 100% 52KB 8.5MB/s 00:00
netQueries.jar 100% 21KB 4.7MB/s 00:00
………
拷貝完成之後,設定環境變數:
[oracle@filesvr1 oracle]$ 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
unset USERNAME
ORACLE_HOME=/opt/oracle/product/9.2.0
ORACLE_BASE=/opt/oracle
export ORACLE_HOME ORACLE_BASE
LD_LIBRARY_PATH=/opt/oracle/product/9.2.0/lib:/lib:/usr/lib:/usr/local/lib
NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
PATH=$PATH:$HOME/bin:$ORACLE_HOME/bin:/sbin:/usr/sbin
export PATH LD_LIBRARY_PATH NLS_LANG
admin=$ORACLE_BASE/admin/$ORACLE_SID/udump
export admin
測試客戶端命令:
[oracle@filesvr1 bin]$ ./sqlplus /nolog
./sqlplus: error while loading shared libraries: libclntsh.so.9.0: cannot open shared object file: No such file or directory
這就很奇怪了,既然環境變數設定正確,為什麼還會提示找不到libclntsh.so.9.0檔案呢?
到 $ORACLE_HOME/lib目錄下查詢,發現libclntsh.so.9.0檔案存在,下面我們使用
ldd 命令檢視sqlplus的依賴的共享庫資訊:
[oracle@filesvr1 oracle]$ ldd product/9.2.0/bin/sqlplus
libclntsh.so.9.0 => not found
libwtc9.so => not found
libdl.so.2 => /lib/libdl.so.2 (0xb75d9000)
libm.so.6 => /lib/tls/libm.so.6 (0xb75b7000)
libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb75a6000)
libnsl.so.1 => /lib/libnsl.so.1 (0xb7591000)
libc.so.6 => /lib/tls/libc.so.6 (0xb7459000)
/lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb75eb000)
發現,確實提示找不到libclntsh.so.9.0相關檔案,看來是環境變數的設定沒有生效,問題一時陷入困境。
冥思苦想,偶然間發現oracle使用者的主目錄不是/opt/oracle, 我暈暈暈。。。
[oracle@filesvr1 oracle]$ pwd
/home/oracle
怪不得環境設定不生效呢,原來SA在安裝系統之後建立oracle帳戶時,將oracle的使用者目錄建成了/home/oracle,將oracle使用者刪掉重建,然後重新拷貝oracle客戶端檔案、設定環境變數即可。
經驗教訓: 雖然公司的oracle安裝規範是將oracle使用者的主目錄建在/opt/oracle, 但是SA也許並不知道這一點,尤其是一個新的SA , SA不可靠哦 ^_^
看來Oracle使用者建立和相關設定最好還是DBA來完成吧。
--The End--
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7220098/viewspace-196158/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- error while loading shared libraries 錯誤解決辦法總結ErrorWhile
- 解決"error while loading shared libraries: libclntshErrorWhile
- Mysql的error while loading shared libraries解決方法MySqlErrorWhile
- error while loading shared librariesErrorWhile
- 使用SRVCTL時報錯:error while loading shared librariesErrorWhile
- sqlplus: error while loading shared libraries的解決方案SQLErrorWhile
- MySQL 啟動報錯 error while loading shared librariesMySqlErrorWhile
- ./ggsci: error while loading shared librariesErrorWhile
- 故障解決:error while loading shared libraries: libncurses.so.5ErrorWhile
- sqlplus: error while loading shared librariesSQLErrorWhile
- 錯誤"error while loading shared libraries: xxx.so.x" 的原因和解決辦法ErrorWhile
- error while loading shared libraries: xxx.so.x"錯誤的原因和解決辦法ErrorWhile
- "error while loading shared libraries: xxx.so.x" 錯誤的原因和解決辦法ErrorWhile
- [mysql]error while loading shared libraries: libaio.so.1: 解決方案MySqlErrorWhileAI
- error while loading shared libraries: libaio.so.1ErrorWhileAI
- Error while loading shared libraries: libssl.so.6:ErrorWhile
- mongod: error while loading shared libraries: libstdc++.so.6GoErrorWhileC++
- error while loading shared libraries: libclntsh.so.10.1ErrorWhile
- innobackupex: error while loading shared libraries: libssl.so.6ErrorWhile
- glodengate配置時報ggsci: error while loading shared librariesErrorWhile
- ORACLE SQLPLUS 報 error while loading shared libraries[轉]OracleSQLErrorWhile
- error while loading shared libraries: libcap.so.1: cannot open sharedErrorWhile
- MongoDB報錯mongorestore: error while loading shared libraries: libsasl2.so.2MongoDBRESTErrorWhile
- error while loading shared libraries: libgsl.so.27: cannot open shared objectErrorWhileObject
- error while loading shared libraries: libgconf-2.so.4:ErrorWhileGC
- ggsci: error while loading shared libraries: libnnz11.soErrorWhile
- error while loading shared libraries: libstdc++.so.5: cannot openErrorWhileC++
- csscan: error while loading shared libraries: libclntsh.so.10.1CSSErrorWhile
- sqlldr執行報錯:error while loading shared libraries: libclntsh.so.10.1:SQLErrorWhile
- 【故障處理】csscan工具無法使用,報錯“error while loading shared libraries...”CSSErrorWhile
- error while loading shared libraries: libmysqlclient.so.16: cannot open shared object file: No suchErrorWhileIBMMySqlclientObject
- sqlplus: error while loading shared libraries: libaio.so.1:SQLErrorWhileAI
- MySQL 5.7初始化報錯error while loading shared libraries: libnuma.so.1MySqlErrorWhile
- sqlplus: error while loading shared libraries: libsqlplus.soSQLErrorWhile
- Error while loading shared libraries: libreadline.so.7: cannot open shared objecErrorWhileOBJ
- error while loading shared libraries: libodm9.so: cannot open shared object file: No such file or diErrorWhileObject
- rac安裝過程中 error while loading shared libraries libpthread.so.0 問題的解決ErrorWhilethread
- 執行csscan出現loading shared libraries錯誤CSS