1 .下载Oracle客户端
Instant Client for Linux x86-64 (64-bit)
目录:
oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64
oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64
oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64
切换 su root 命令,切换用户进行安装:
# su root
安装命令:
rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
rpm -ivh oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
切换 su ?- oracle 命令,切换到oracle用户配置环境变量:
查看环境变量:
输入:
echo $HOME
显示:
/home/oracle
l输入:
s -a
显示:
.bash_profile 内容!
进入目录:
cd /home/oracle/
编辑文件:
vi .bash_profile
在.bash_profile中添加,如下内容:
export ORACLE_BASE=/usr/lib/oracle
export ORACLE_HOME=$ORACLE_BASE/11.2/client64
export PATH=$ORACLE_HOME/bin:/usr/lib/oracle:$PATH
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export SQLPATH=/usr/lib/oracle
export TNS_ADMIN=/usr/lib/oracle/11.2/client64/network/admin
重启服务器,即可,查看客户端安装是否成功!(完)