在一台装有oracle9i,执行sqlplus时出现了问题,错误提示信息如下:
[oracle@data
bin]$ ./sqlplus /nolog
error while loading
shared libraries: libclntsh.so.9.0: cannot open shared object file: No such file
or
directory
具体情况如下:
[oracle@data 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
使用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)
到oracle的home目录里查找,确实提示找不到libclntsh.so.9.0相关文件,从别的同版本的机器上拷贝一同名文件过来,重新执行sqlplus,显示如下,正常!
[oracle@backup oracle]$ sqlplus /nolog
SQL*Plus: Release 9.2.0.4.0 - Production on Mon Jan 5 10:29:41 2009
Copyright (c) 1982, 2002, Oracle Corporation. All rights reserved.
SQL>
如果oracle环境变量设置不正确的话,也可能出现上述情况,比如说oracle的bash_profile中设置的ORACLE_HOME=/opt/oracle/product/9.2.0,而实际oracle安装在/home/oracle下,同样会找不到文件报错。如果是这样的话,只需要重新设置oracle的环境变量值即可解决问题。
阅读(4375) | 评论(0) | 转发(0) |