http://www.oracle.com/technology/tech/oci/instantclient/index.html下載下傳:
oracle-instantclient-basic-10.2.0.4-1.i386.zip
oracle-instantclient-sqlplus-10.2.0.4-1.i386.zip
先建立用戶端的安裝目錄,這兩個目錄可以自定義,但配置環境變量時,需要一緻。
mkdir -p /opt/oracle/lib
mkdir -p /opt/oracle/network/admin
(有文章說還需要下載下傳sdk,這裡沒下載下傳試過也可以。)
解壓上面下載下傳的檔案。
unzip oracle-instantclient-basic-10.2.0.4-1.i386.zip
unzip oracle-instantclient-sqlplus-10.2.0.4-1.i386.zip
其中,這二個檔案都解壓到目前目錄下的同一個目錄下面:
instantclient_10_2
cd instantclient_10_2
把這個目錄下的所有檔案搬到/opt/oracle/lib
若僅讓目前使用者能用sqlplus,則僅需要配置檔案的修改:
.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
現:
fi
ORACLE_HOME=/opt/oracle
LD_LIBRARY_PATH=/opt/oracle/lib
PATH=.:$PATH:$HOME/bin:$LD_LIBRARY_PATH//若無此處,則打開一個shell後,不能用sqlplus。
export ORACLE_HOME
export LD_LIBRARY_PATH
有文章介紹需要修改/etc/profile配置環境變量,針對所有使用者。