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
先創(chuàng)建客戶端的安裝目錄,這兩個目錄可以自定義,但配置環(huán)境變量時,需要一致。
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
其中,這二個文件都解壓到當(dāng)前目錄下的同一個目錄下面:
instantclient_10_2
cd instantclient_10_2
把這個目錄下的所有文件搬到/opt/oracle/lib
若僅讓當(dāng)前用戶能用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
現(xiàn):
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
ORACLE_HOME=/opt/oracle
LD_LIBRARY_PATH=/opt/oracle/lib
PATH=.:$PATH:$HOME/bin:$LD_LIBRARY_PATH//若無此處,則打開一個shell后,不能用sqlplus。
export PATH
export ORACLE_HOME
export LD_LIBRARY_PATH
有文章介紹需要修改/etc/profile配置環(huán)境變量,針對所有用戶。