linux安装oracle客户端【转】

首先Oracle官网下载安装包:

https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.html
 

安装解压缩到/usr/local/oracle

mkdir /usr/local/oracle
unzip /usr/local/oracle/instantclient-basic-linux.x64-11.2.0.4.0.zip
unzip /usr/local/oracle/instantclient-sqlplus-linux.x64-11.2.0.4.0.zip
cd /usr/local/oracle/instantclient_11_2
mkdir -p network/admin
cd network/admin

 

新建tnsnames.ora文件

CM =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.11.12)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cm)
    )
  )
UAT =
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 10.1.1.2)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = uat)
    )
  )

添加环境变量

vi .bash_profile
 
export ORACLE_HOME=/usr/local/oracle/instantclient_11_2
export TNS_ADMIN=$ORACLE_HOME/network/admin
##export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export NLS_LANG=AMERICAN_AMERICA.AL32UTF8
export LD_LIBRARY_PATH=$ORACLE_HOME
export PATH=$ORACLE_HOME:$PATH

 

执行环境变量

source .bash_profile

 

测试数据库连接

sqlplus username/passwd@cm

 

 
转自
linux安装oracle客户端 - hanjianfei - 博客园 https://www.cnblogs.com/hanjianfei/p/11453790.html
(2条消息) linux下快速安装oracle客户端_言蹊的专栏-CSDN博客 https://blog.csdn.net/andy_wcl/article/details/79470705

Linux上搭建Oracle的客户端_数据库技术_Linux公社-Linux系统门户网站 https://www.linuxidc.com/Linux/2019-09/160670.htm

10.1.11.12
posted @ 2020-11-04 15:55  paul_hch  阅读(66)  评论(0编辑  收藏