<Oracle>《Linux 下安装Oracle数据库 - Oracle 19C By CentOS 8 》(第一部分)

1 说明

1.1 前言

本文是Linux系统命令行模式安装Oracle数据库的学习实验记录,根据真实环境操作进行记录。具备较强的可操作性、可重复性。

本次实验在虚拟机环境中完成,Oracle数据库通过在Linux命令行方式安装

本文主要用实操实验方式探究Linux命令行安装Oracle数据库过程。对虚拟机软件安装、虚拟机下Linux环境搭建不做详细展开。

1.2 资源下载

1、虚拟机软件版本:本文使用VMware Workstation 17 Pro
在这里插入图片描述

2、操作系统版本:一键下载

[root@localhost proc]# cat /etc/redhat-release 
CentOS Linux release 8.5.2111

3、数据库版本:一键下载

本文使用Oracle 19C,具体版本为
19.3 - Enterprise Edition (also includes Standard Edition 2)

4、预安装包下载:参考2.2章节

5、本文相关资料已上传站内,可通过百度网盘下载全部内容。
点击跳转下载页面:感谢大家支持!

2 安装步骤

2.1 上传安装包

创建目录,通过SecureFX将数据库安装包上传至服务器。

大家如果遇到上传相关问题,可留言咨询。看到必回。

//创建目录
[root@localhost proc]# mkdir -p /oracle/install
//对目录赋权
[root@localhost proc]# chmod -R 777 /oracle/install
--说明:此时可将文件上传至/Oracle/install目录。

在这里插入图片描述
遗留问题:虚拟网卡传输速度为何限制为100M?

2.2 下载数据库预安装包

命令:

wget http://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

实际操作:

[root@localhost install]# pwd
/oracle/install
[root@localhost install]# ls
oracle-database-ee-19c-1.0-1.x86_64.rpm
[root@localhost install]# wget http://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
--2023-06-24 08:45:51--  http://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
Resolving yum.oracle.com (yum.oracle.com)... 2a02:26f0:2500:1bd::2a7d, 2a02:26f0:2500:1af::2a7d, 2.18.169.81
Connecting to yum.oracle.com (yum.oracle.com)|2a02:26f0:2500:1bd::2a7d|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm [following]
--2023-06-24 08:45:51--  https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
Connecting to yum.oracle.com (yum.oracle.com)|2a02:26f0:2500:1bd::2a7d|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 18204 (18K) [application/x-rpm]
Saving to: ‘oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm’

oracle-database-preinsta 100%[==================================>]  17.78K   106KB/s    in 0.2s    

2023-06-24 08:45:52 (106 KB/s) - ‘oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm’ saved [18204/18204]

[root@localhost install]# ls
oracle-database-ee-19c-1.0-1.x86_64.rpm  oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

2.3 安装数据库预安装包

1、安装命令:

yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

2、第一次安装报错:

[root@localhost install]# yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm 
CentOS Linux 8 - AppStream                                           62  B/s |  38  B     00:00    
Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist

3、解决第一次报错,参考:点击跳转。主要操作步骤如下:

//进入yum的repos目录
cd /etc/yum.repos.d/

//修改 centos 文件内容
sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

//生成缓存更新
yum makecache

//运行yum update(该步骤较慢)
yum update -y

//返回安装目录重新执行命令
[root@localhost yum.repos.d]# cd /oracle/install/
[root@localhost install]# ls
oracle-database-ee-19c-1.0-1.x86_64.rpm  oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
[root@localhost install]# yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm 

4、再次执行,出现第二次报错:

[root@localhost install]# yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm 
Last metadata expiration check: 0:06:14 ago on Sat 24 Jun 2023 08:58:15 AM PDT.
Error: 
 Problem: conflicting requests
  - nothing provides compat-libcap1 needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
  - nothing provides compat-libstdc++-33 needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)

5、解决第二次报错:参考文章跳转

//尝试忽略,但是安装未成功。
[root@localhost install]# yum install --skip-broken oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
Last metadata expiration check: 0:04:39 ago on Sat 24 Jun 2023 09:08:19 AM PDT.
Dependencies resolved.
Nothing to do.
Complete!

//根据参考文章执行命令
[root@localhost install]# sudo rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
warning: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
error: Failed dependencies:
        compat-libcap1 is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
        compat-libstdc++-33 is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
        ksh is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
        libaio-devel is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
        libstdc++-devel is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
        sysstat is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64
        xorg-x11-utils is needed by oracle-database-preinstall-19c-1.0-1.el7.x86_64

//果然如文章所言存在异常,先执行这个,在执行上面步骤
curl -o compat-libcap1-1.10-7.el7.x86_64.rpm http://mirror.centos.org/centos/7/os/x86_64/Packages/compat-libcap1-1.10-7.el7.x86_64.rpm
//并没有用。


sudo rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm --force --nodeps

6、解决过程存在问题。参考下面文章解决:点击跳转。将命令进行修改,执行成功。
正确命令如下

[root@localhost install]# sudo rpm -ivh oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm --force --nodeps
warning: oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID ec551f03: NOKEY
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:oracle-database-preinstall-19c-1.################################# [100%]

7、进行验证,如下为成功:

[root@localhost install]# id oracle
uid=65535(oracle) gid=65535(oinstall) groups=65535(oinstall),65541(racdba),65536(dba),65537(oper),65538(backupdba),65539(dgdba),65540(kmdba)
[root@localhost install]# 

第一日学习结束。。。

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Ealser

坚持免费。使命普及。

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值