Ubuntu14.04安装Oracle Instant Client

前端之家收集整理的这篇文章主要介绍了Ubuntu14.04安装Oracle Instant Client前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

安装环境

本文介绍在ubuntu14.04系统(X64)上安装OracleInstant Client,安装版本为11.2.0.4.0(读者需要按照自己安装版本修改相应的版本号)

安装RPM文件

oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm
  • 使用alien转换PRM文件到DEB文件并安装(sudo apt-get install alien)

  • 安装alien后,执行下面的命令安装Oracle客户端

sudo alien -i oracle-instantclient11.2-basic-11.2.0.4.0-1.x86_64.rpm
sudo alien -i oracle-instantclient11.2-devel-11.2.0.4.0-1.x86_64.rpm
sudo alien -i oracle-instantclient11.2-sqlplus-11.2.0.4.0-1.x86_64.rpm

配置Oracle环境

  • 安装以下步骤新增tnsnames.ora文件

cd /usr/lib/oracle/11.2/client64
sudo mkdir -p network/admin
sudo vi tnsnames.ora
# tnsnames.ora Network Configuration File
ZBUDCDB_STDBY =
 (DESCRIPTION =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 10.100.126.174)(PORT = 1521))
  (CONNECT_DATA =
   (SERVER = DEDICATED)
   (SERVICE_NAME = zbudcdb_stdby)
  )
 )
sudo ln -s /usr/include/oracle/11.2/client64 /usr/lib/oracle/11.2/client64/include

配置环境变量

登录用户的profile中增加以下内容

export ORACLE_HOME=/usr/lib/oracle/11.2/client64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:$ORACLE_HOME/bin
export NLS_LANG="AMERICAN_AMERICA.UTF8"
测试:
sqlplus 'name/password@10.100.126.174:1521/ZBUDCDB_STDBY'
登录成功:
 原文链接:https://www.f2er.com/ubuntu/353255.html

猜你在找的Ubuntu相关文章