sqlldr執行報錯:error while loading shared libraries: libclntsh.so.10.1:

myownstars發表於2011-01-15
執行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/,如需轉載,請註明出處,否則將追究法律責任。

相關文章