签到成功

知道了

CNDBA社区CNDBA社区

Linux下安装Oracle Client端

2022-02-21 14:47 1653 0 原创 oracle
作者: hbhe0316

登录Oracle 官网,下载Oracle Client For X86 Linux
https://www.oracle.com/database/technologies/instant-client/linux-x86-64-downloads.htmlhttp://www.cndba.cn/hbhe0316/article/107757

如下为Oracle client安装包http://www.cndba.cn/hbhe0316/article/107757

http://www.cndba.cn/hbhe0316/article/107757

instantclient-basic-linux.x64-19.14.0.0.0dbru.zip
instantclient-sqlplus-linux.x64-19.14.0.0.0dbru.zip
instantclient-tools-linux.x64-19.14.0.0.0dbru.zip

1.创建oracle组和oracle用户名

http://www.cndba.cn/hbhe0316/article/107757

[root@node01 tmp]# groupadd oinstall
[root@node01 tmp]# groupadd dba
[root@node01 tmp]# useradd -g oinstall -G dba oracle

2.解压oracle client安装包,如下为安装到/oracle下http://www.cndba.cn/hbhe0316/article/107757http://www.cndba.cn/hbhe0316/article/107757

[root@node01 tmp]# unzip instantclient-basic-linux.x64-19.14.0.0.0dbru.zip -d /oracle/
[root@node01 tmp]# unzip instantclient-sqlplus-linux.x64-19.14.0.0.0dbru.zip -d /oracle/
[root@node01 tmp]# unzip instantclient-tools-linux.x64-19.14.0.0.0dbru.zip -d /oracle/

3.设置oracle环境变量
unzip命令解压三个文件。会生成一个文件夹:instantclient_19_14
配置环境变量 vim /etc/profile在最后一行加上

export ORACLE_HOME=/oracle/instantclient_19_14
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/oracle/instantclient_19_14
export PATH=$ORACLE_HOME/:$PATH

4.修改/oracle文件夹属主为oracle

http://www.cndba.cn/hbhe0316/article/107757
http://www.cndba.cn/hbhe0316/article/107757

[root@node01 tmp]# chown -R oracle.oinstall /oracle

5.创建tnsnames.ora文件

[oracle@node01 admin]$ su - oracle
[oracle@node01 admin]$ cd /oracle/instantclient_19_14/network/admin
[oracle@node01 admin]$ touch tnsnames.ora
[oracle@node01 admin]$ cat tnsnames.ora
PRCLDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.100)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = PRCLDB)
    )
  )

LISTENER_PDTPDB =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.56.100)(PORT = 1521))

6.使用sqlplus连接远端Oraclehttp://www.cndba.cn/hbhe0316/article/107757

http://www.cndba.cn/hbhe0316/article/107757

[oracle@node01 admin]$ sqlplus system/wwwwww@PRCLDB

SQL*Plus: Release 19.0.0.0.0 - Production on Mon Feb 21 14:15:44 2022
Version 19.14.0.0.0

Copyright (c) 1982, 2021, Oracle.  All rights reserved.

Last Successful login time: Mon Feb 21 2022 14:13:47 +08:00

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.11.0.0.0

SQL>

版权声明:本文为博主原创文章,未经博主允许不得转载。

oracle

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
hbhe0316

hbhe0316

关注

1.只有承认无知,才能装下新的东西; 2.进步来自一点点滴滴的积累; 3.广博让你更优秀,而专业让你无法替代; 4.挫折和失败能够转换为一种财富。

  • 889
    原创
  • 1
    翻译
  • 13
    转载
  • 24
    评论
  • 访问:1039892次
  • 积分:1523
  • 等级:核心会员
  • 排名:第6名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ