sqlldr执行报错:error while loading shared libraries: libclntsh.so.10.1:

执行shell脚本的时候
[root@justin]# sh sqlldr_justin.sh
/home/oracle/10205/db1/bin/./sqlldr: error while loading shared libraries: libclntsh.so.10.1: cannot open shared object file: No such file or directory
报以上错误

其实是环境变量没有设置正确,可以通过export ORACLE_HOME=**之类的命令修复,不过每次都这么敲命令太麻烦.
通过设置.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 env
ORACLE_BASE=/home/oracle
ORACLE_HOME=$ORACLE_BASE/10205/db1
ORA_CRS_HOME=$ORACLE_BASE/10205/crs/
export ORACLE_BASE ORACLE_HOME
ORACLE_SID=test
export ORACLE_SID
ORACLE_TERM=xterm
export ORACLE_TERM
LD_LIBRARY_PATH=$ORACLE_HOME/lib:/lib:/usr/lib
export LD_LIBRARY_PATH
CLASSPATH=$ORACLE_HOME/JRE:$ORACLE_HOME/jlib:$ORACLE_HOME/rdbms/jlib
export CLASSPATH
PATH=$HOME/bin:$ORACLE_HOME/bin:$PATH:/sbin/


export PATH

接着执行shell脚本,成功
[root@justin]# source .bash_profile
[root@justin]# sh sqlldr_justin.sh

SQL*Loader: Release 10.2.0.5.0 - Production on Tue Dec 28 15:18:45 2010

Copyright (c) 1982, 2007, Oracle.  All rights reserved.


Load completed - logical record count 208.

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/15480802/viewspace-688362/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/15480802/viewspace-688362/

你可能感兴趣的:(sqlldr执行报错:error while loading shared libraries: libclntsh.so.10.1:)