Linux -- Centos7下部署Oracle客户端

下载安装包

  去oracle官网下载下面软件包,根据自己需要选择:
    oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
  下载链接: oracle-instantclient

安装

  • 使用rpm -qpl命令查看oracle client默认安装路径:
[root@ecs-523a-0002 ~]# rpm -qpl oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
/usr/lib/oracle/11.2/client64/bin/adrci
/usr/lib/oracle/11.2/client64/bin/genezi
/usr/lib/oracle/11.2/client64/lib/libclntsh.so.11.1
/usr/lib/oracle/11.2/client64/lib/libnnz11.so
/usr/lib/oracle/11.2/client64/lib/libocci.so.11.1
/usr/lib/oracle/11.2/client64/lib/libociei.so
/usr/lib/oracle/11.2/client64/lib/libocijdbc11.so
/usr/lib/oracle/11.2/client64/lib/ojdbc5.jar
/usr/lib/oracle/11.2/client64/lib/ojdbc6.jar
/usr/lib/oracle/11.2/client64/lib/xstreams.jar
  • 由上面的查询结果可知oracle client默认安装在/usr/lib目录下,如果想让oracle client安装在自己指定的目录下,可以使用rpm -ivh –relocate重定向默认安装路径的前缀,例如:
rpm -ivh –relocate /usr=/oracle oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
  • 我们这里就默认安装了
rpm -ivh oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm

配置环境变量

  • vi /etc/profile
# oracle client
export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export TNL_ADMIN=$ORACLE_HOME/network/admin
# 国家字符集编码
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
#export NLS_LANG="Simplified Chinese_china".ZHS16GBK
export PATH=$PATH:$ORACLE_HOME/bin
  • source /etc/profile

你可能感兴趣的:(Linux)