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
现:
# .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配置环境变量,针对所有用户。