资讯专栏INFORMATION COLUMN

Install Oracle Instant Client on Linux and Windows

ThinkSNS / 256人阅读

摘要:前言本篇文章用最简单和快速的方法介绍如何在安装,该方法同样适用于,,,。是官方免费授权的一种比还要简单的数据库管理工具,通过或者其它工具比如等用于快速连接和管理数据库服务器。

前言

本篇文章用最简单和快速的方法介绍如何在Red Hat Enterprise Linux安装Oracle Instant Client,该方法同样适用于Windows,RHEL5/6/7,OEL,CentOS。Oracle Instant Client是官方免费授权的一种比Oracle Client还要简单的数据库管理工具,通过SQL*Plus或者其它工具比如Navicat等用于快速连接和管理Oracle数据库服务器。

Install Oracle instantclient basic and instantclient sqlplus on Linux and Windows.

更新记录

2017年08月10日 - 初稿

阅读原文 - https://wsgzao.github.io/post...

扩展阅读

Oracle Instant Client Downloads - http://www.oracle.com/technet...

Oracle Instant Client Downloads

文章内容均已64位版本为例,如果客户端有特殊需求请使用32位版本兼容

Linux Oracle Instant Client推荐使用RPM方式安装,如果需要定制具体路径可以使用zip包手动配置

Windows和Linux类似但需要主要PATH环境变量的配置

实测12版本客户端可以向下兼容11版本的数据库服务器,Oracle Instant Client 12.2.0.1.0,Oracle Database 11.2.0.3.0

下载地址
http://www.oracle.com/technet...

百度网盘分流
http://pan.baidu.com/s/1slhoZEH

Linux

以RPM最简方式为例

Preparation

Download all the required RPM from the official site and put them on the target system.
Current RPMs for 64bit are:
oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm
oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm

Install RPMs
# install as root
rpm -ivh oracle-instantclient12.2-basic-12.2.0.1.0-1.x86_64.rpm oracle-instantclient12.2-sqlplus-12.2.0.1.0-1.x86_64.rpm

# create oracle group and user
groupadd dba 
useradd -g dba oracle
echo oracle:oracle | chpasswd

# configure profile
su - oracle
vi ~/.bash_profile 

export LD_LIBRARY_PATH=/usr/lib/oracle/12.2/client64/lib
export TNS_ADMIN=/usr/lib/oracle/12.2/client64/
export PATH=/usr/lib/oracle/12.2/client64/bin:$PATH

# Connect to Your database with:
sqlplus system/oracle@oracapdb

# create new tnsnames.ora
# ORA-12154: TNS:could not resolve the connect identifier specified
vim /usr/lib/oracle/12.2/client64/tnsnames.ora

oracapdb =
   (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.70.244)(PORT = 1521))
          (CONNECT_DATA =
        (SERVER = DEDICATED)
      (SERVICE_NAME = oracapdb)
   )
)

# You can also use the Easy Connect connection string format (does not use TNSNAMES):
sqlplus system/oracle@//172.28.70.244:1521/oracapdb
Windows

Windows的配置相比Linux差不多简单,注意环境变量尤其是TNS_ADMIN

Preparation

国外一篇图文并茂的文章写的也很详细,有需要可以参考下
Installing Oracle instantclient basic and instantclient sqlplus on win32
http://www.dbatoolz.com/t/ins...

Go to Instant Client Downloads for Microsoft Windows download page:
http://www.oracle.com/technol...

unzip files
# 下载解压以下两个包至目录,比如C:instantclient_12_2
instantclient-basic-windows.x64-12.2.0.1.0.zip
instantclient-sqlplus-windows.x64-12.2.0.1.0.zip

# 设置环境变量
计算机右键【属性】----【高级系统设置】----【环境变量】----【系统变量】----【Path】

# Setup your system %PATH% and %TNS_ADMIN% variables
C:instantclient_12_2

# Connect to Your database with:
sqlplus system/oracle@oracapdb

# TNS_ADMIN
# ORA-12154: TNS:could not resolve the connect identifier specified
Variable Name: TNS_ADMIN
Variable Value: C:instantclient_12_2

# create new tnsnames.ora
C:instantclient_12_2	nsnames.ora

oracapdb =
   (DESCRIPTION =
      (ADDRESS = (PROTOCOL = TCP)(HOST = 172.28.70.244)(PORT = 1521))
          (CONNECT_DATA =
        (SERVER = DEDICATED)
      (SERVICE_NAME = oracapdb)
   )
)

# You can also use the Easy Connect connection string format (does not use TNSNAMES):
sqlplus system/oracle@//172.28.70.244:1521/oracapdb

文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。

转载请注明本文地址:https://www.ucloud.cn/yun/35284.html

相关文章

  • Install Oracle Instant Client on Linux and Windows

    摘要:前言本篇文章用最简单和快速的方法介绍如何在安装,该方法同样适用于,,,。是官方免费授权的一种比还要简单的数据库管理工具,通过或者其它工具比如等用于快速连接和管理数据库服务器。 前言 本篇文章用最简单和快速的方法介绍如何在Red Hat Enterprise Linux安装Oracle Instant Client,该方法同样适用于Windows,RHEL5/6/7,OEL,CentOS...

    lykops 评论0 收藏0
  • 解决Error: NJS-045错误 ubuntu环境配置Nodejs访问Oracle

    摘要:解决错误环境配置访问最近在公司鼓捣一个小型项目,技术栈选用了,需要访问的数据在公司生产库里面,生产库使用的是。直接访问生产库获取数据太危险,所以需要定时从生产库中抽取加工后的数据然后写入到中。 解决Error: NJS-045错误 ubuntu环境配置Nodejs访问Oracle 最近在公司鼓捣一个小型项目,技术栈选用了Vue2.0+Nodejs+Express+Mongodb+lin...

    Pines_Cheng 评论0 收藏0
  • 解决Error: NJS-045错误 ubuntu环境配置Nodejs访问Oracle

    摘要:解决错误环境配置访问最近在公司鼓捣一个小型项目,技术栈选用了,需要访问的数据在公司生产库里面,生产库使用的是。直接访问生产库获取数据太危险,所以需要定时从生产库中抽取加工后的数据然后写入到中。 解决Error: NJS-045错误 ubuntu环境配置Nodejs访问Oracle 最近在公司鼓捣一个小型项目,技术栈选用了Vue2.0+Nodejs+Express+Mongodb+lin...

    LdhAndroid 评论0 收藏0
  • 解决Error: NJS-045错误 ubuntu环境配置Nodejs访问Oracle

    摘要:解决错误环境配置访问最近在公司鼓捣一个小型项目,技术栈选用了,需要访问的数据在公司生产库里面,生产库使用的是。直接访问生产库获取数据太危险,所以需要定时从生产库中抽取加工后的数据然后写入到中。 解决Error: NJS-045错误 ubuntu环境配置Nodejs访问Oracle 最近在公司鼓捣一个小型项目,技术栈选用了Vue2.0+Nodejs+Express+Mongodb+lin...

    Kerr1Gan 评论0 收藏0
  • Navicat使用Instant Client创建连接到Oracle数据库的正确姿势

    摘要:今天就和大家分享一下使用连接数据库的正确姿势。在普通的情况下,用户可以通过和来访问数据库中的数据。通俗地讲,就是一个使用来访问数据库的一个图形化界面。他是这么描述的看不懂没关系要么谷歌要么度娘。原理,请自行谷歌。 太长不看版: 1.你什么操作系统,Instant Client就选什么操作系统 2.你的navicat是多少位(32、64),Instant Client就选多少位 3.你的...

    yanwei 评论0 收藏0

发表评论

0条评论

最新活动
阅读需要支付1元查看
<