温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Oracle RPM包安装Oracle19c

发布时间:2020-08-04 14:54:17 来源:ITPUB博客 阅读:218 作者:DBhanG 栏目:关系型数据库

RPM包安装Oracle19c

一 说明

  • 1.1 Linux下Oracle操作系统要求 :
    Oracle Linux 8.1 with the Unbreakable Enterprise Kernel 6: 5.4.17-2011.0.7.el8uek.x86_64 or later
    Oracle Linux 8 with the Red Hat Compatible kernel: 4.18.0-80.el8.x86_64 or later
    Oracle Linux 7.4 with the Unbreakable Enterprise Kernel 4: 4.1.12-124.19.2.el7uek.x86_64 or later
    Oracle Linux 7.4 with the Unbreakable Enterprise Kernel 5: 4.14.35-1818.1.6.el7uek.x86_64 or later
    Oracle Linux 7.5 with the Red Hat Compatible kernel: 3.10.0-862.11.6.el7.x86_64 or later
    Red Hat Enterprise Linux 8: 4.18.0-80.el8.x86_64 or later
    Red Hat Enterprise Linux 7.5: 3.10.0-862.11.6.el7.x86_64 or later
    SUSE Linux Enterprise Server 12 SP3: 4.4.162-94.72-default or later
    SUSE Linux Enterprise Server 15: 4.12.14-23-default or later
    本次安装环境为:Red Hat Enterprise Linux 7.5

  • 1.2 介质需求
    (1)oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm //安装前预检查
    下载地址:
    https://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm
    (2)oracle-database-ee-19c-1.0-1.x86_64.rpm //oracle19c数据库软件包
    https://www.oracle.com/database/technologies/oracle19c-linux-downloads.html

二 操作系统基础配置

  • 2.1 检查服务器硬件和内存配置
    使用以下命令确定服务器上的物理RAM大小至少1G以上
    grep MemTotal /proc/meminfo
    确定配置的交换空间的大小
    grep SwapTotal /proc/meminfo
    确定tmp目录空间足够1G
    df -h /tmp
    (如果/tmp空间不足,则清理/tmp目录以满足磁盘空间要求。
    或设置Oracle用户环境时,还要设置TMP和TMPDIR环境变量到要使用的目录中,而不是/tmp)
    确定系统版本能够支持19c数据库 uname -m

  • 2.2 关闭防火墙
    关闭运行中的服务
    systemctl stop firewalld
    关闭操作系统自启动
    systemctl disable firewalld
    检查关闭情况
    systemctl status firewalld
    如下,dead表示未开启开机启动;inactive表示现在的状态是关闭
    Oracle RPM包安装Oracle19c

  • 2.3关闭selinux:
    编辑/etc/selinux/config 文件
    [root @byh ~]# vi /etc/selinux/config

    SELINUX=disabled
    
  • 2.4配置系统参数

    编辑/etc/pam.d/login 添加如下内容:
     vi /etc/pam.d/login 
     session    required     pam_limits.so
    编辑vi /etc/profile添加如下内容:   #系统环境变量
    if [ /$USER = "oracle" ] ; then
      if [ /$SHELL = "/bin/ksh" ]; then
      ulimit -p 16384
      ulimit -n 65536
    else
      ulimit -u 16384 -n 65536
    fi
      umask 022
    fi
     编辑/etc/security/limits.conf 添加如下内容:
     vi /etc/security/limits.conf 
     oracle soft nproc 2047
     oracle hard nproc 16384
     oracle soft nofile 1024
     oracle hard nofile 65536
    
  • 2.5 配置Yum源
    方式一:
    本地Yum源:
    挂载光驱
    mount /dev/cdrom /mnt
    配置yum:
    vi /etc/yum.repos.d/dvd.repo 添加如下:
    [dvd]
    name=dvd
    baseurl=file:///mnt
    gpgcheck=0

    方式二://在允许与外网通信的情况下
    网络Yum源:
    wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
    sed -i ‘s/$releasever/7/g’ /etc/yum.repos.d/CentOS-Base.repo
    yum clean all

  • 2.6 安装预安装包
    yum -y localinstall oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

    使用yum安装oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm,会自动解决所有19c所依赖的软件包,并且也会自动配置内核参数。
    Oracle RPM包安装Oracle19c

如果本地镜像源软件包不全,可能许多依赖包无法安装。

Oracle RPM包安装Oracle19c

此时就需要我们使用网络源来下载这些软件包。

  • 2.7 安装19c数据库软件rpm包
    将介质传输到/tmp下 进行安装
    cd /tmp
    yum -y localinstall oracle-database-ee-19c-1.0-1.x86_64.rpm
    安装完毕之后,oracle用户以及oinstall组自动创建好,软件安装在/opt/oracle/product/19c/dbhome_1下,并且该软件安装位置无法修改

  • 2.8 配置Oracle用户的环境变量
    su – oracle
    vi ~/.bash_profile
    export ORACLE_BASE=/opt/oracle
    export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
    export PATH=$ORACLE_HOME/bin:$PATH
    export ORACLE_SID=ORCLCDB

    source .bash_profile //重新加载环境变量

三 创建数据库实例
方法一:
成功安装数据库软件后,会生成一个数据库实例配置脚本,并且会提示出脚本的位置,按自己实际需求去配置该脚本,然后执行。
Oracle RPM包安装Oracle19c

方法二:
使用常规的DBCA进行创建数据库实例


  • 3.1 配置脚本
    编辑/etc/init.d/oracledb_ORCLCDB-19c可以对安装的数据库进行配置
    [root @byh ~]#su – root
    [root @byh ~]#cd /etc/init.d/
    [root @byh ~]#vi oracledb_ORCLCDB-19c
    按实际需求修改:
    Oracle RPM包安装Oracle19c

  • 3.2执行脚本安装
    然后运行以下脚本,进行安装
    [root @byh ~]# /etc/init.d/oracledb_ORCLCDB-19c configure
    Oracle RPM包安装Oracle19c

ending

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI