安装环境
本文介绍在ubuntu14.04系统(X64)上安装OracleInstant Client,安装版本为11.2.0.4.0(读者需要按照自己安装版本修改相应的版本号)
安装RPM文件
-
在Oracle官网地址http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html下载以下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
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
配置环境变量
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