「Oracle」Oracle 数据库安装

作者:threedayman

来源:恒生LIGHT云社区

安装包下载地址

https://www.oracle.com/cn/database/technologies/oracle-database-software-downloads.html#19c

image-20211117161530646.png

我们选用RPM包下载安装。

安装帮助文档

https://docs.oracle.com/en/database/oracle/oracle-database/19/ladbi/preface.html#GUID-071A6B76-11E3-4421-963E-41DA6F2EF07A

安装环境

cat /etc/redhat-release 
CentOS Linux release 7.7.1908 (Core)

在非OralceLinux环境下安装,需要下载对应平台的rpm。

下载地址:https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/index.html,搜索-19c下载最新版本即可。

安装

首先执行

[root@linuxtestb538 oracle]# rpm -ivh oracle-database-preinstall-19c-1.0-3.el7.x86_64.rpm 
warning: oracle-database-preinstall-19c-1.0-3.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
        bind-utils is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        compat-libcap1 is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        ksh is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        smartmontools is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        sysstat is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64
        xorg-x11-utils is needed by oracle-database-preinstall-19c-1.0-3.el7.x86_64

执行出现缺少依赖错误。

改用yum命令进行安装

 yum install oracle-database-preinstall-19c-1.0-3.el7.x86_64.rpm
 Installed:
  oracle-database-preinstall-19c.x86_64 0:1.0-3.el7                                                                                                                        

Dependency Installed:
  GeoIP.x86_64 0:1.5.0-14.el7                             bind-libs.x86_64 32:9.11.4-26.P2.el7_9.7              bind-libs-lite.x86_64 32:9.11.4-26.P2.el7_9.7            
  bind-license.noarch 32:9.11.4-26.P2.el7_9.7             bind-utils.x86_64 32:9.11.4-26.P2.el7_9.7             compat-libcap1.x86_64 0:1.10-7.el7                       
  geoipupdate.x86_64 0:2.5.0-1.el7                        ksh.x86_64 0:20120801-142.el7                         smartmontools.x86_64 1:7.0-2.el7                         
  sysstat.x86_64 0:10.1.5-19.el7                          xorg-x11-utils.x86_64 0:7.5-23.el7                   

Complete!

安装Oracle数据库

 yum install oracle-database-ee-19c-1.0-1.x86_64.rpm 
 Installed:
  oracle-database-ee-19c.x86_64 0:1.0-1                                                                      
Complete!

配置数据库

/etc/init.d/oracledb_ORCLCDB-19c configure
100% complete
Database creation complete. For details check the logfiles at:
 /opt/oracle/cfgtoollogs/dbca/ORCLCDB.
Database Information:
Global Database Name:ORCLCDB
System Identifier(SID):ORCLCDB
Look at the log file "/opt/oracle/cfgtoollogs/dbca/ORCLCDB/ORCLCDB.log" for further details.

Database configuration completed successfully. The passwords were auto generated, you must change them by connecting to the database using 'sqlplus / as sysdba' as the oracle user.

配置好后设置当前用户下的环境变量

vi ~/.bashrc    (打开文件后追加oracle的环境变量信息)
---------------------------------------------------
export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1 
export ORACLE_SID=ORCLCDB
export PATH=$ORACLE_HOME/bin:$PATH
---------------------------------------------------

通过运行
source ~/.bashrc  (命令运行后设置的环境变量生效)

验证安装是否正确

su oracle   (用户切换到oracle用户)
sysplus / as sysdba
SQL*Plus: Release 19.0.0.0.0 - Production on Wed Nov 17 18:59:32 2021
Version 19.3.0.0.0

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


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

SQL> 

运行以上命令 确认Oracle数据库是否能够正确连接成功。

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值