首页数据库CentOS7下Oracle19c rpm安装过程

CentOS7下Oracle19c rpm安装过程

时间2024-02-28 17:37:04发布访客分类数据库浏览561
导读:收集整理的这篇文章主要介绍了CentOS7下Oracle19c rpm安装过程,觉得挺不错的,现在分享给大家,也给大家做个参考。 软件...
收集整理的这篇文章主要介绍了CentOS7下Oracle19c rpm安装过程,觉得挺不错的,现在分享给大家,也给大家做个参考。

软件 下载地址
CentOS-7-x86_64-Minimal-2009.iso http://mirrors.163.com/centos/7.9.2009/isos/x86_64/CentOS-7-x86_64-Minimal-2009.iso
oracle-database-PReinstall-19c-1.0-1.el7.x86_64.rpm https://www.aliyundrive.com/s/F9ziMB6nPbp
oracle-database-ee-19c-1.0-1.x86_64.rpm https://www.aliyundrive.com/s/E6m5e8CCGq2

一. 环境配置

​虚拟机安装建议分2G内存,30G硬盘。

关闭防火墙(或放行相关端口)

Systemctl stop firewalldsystemctl disable firewalld

关闭selinux

修改SELINUX=disabled

vi /etc/selinux/config

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
#     enforcing - SELinux securITy policy is enforced.
#     PErmissive - SELinux prints warnings instead of enforcing.
#     disabled - No SELinux policy is loaded.
SELINUX=disabled
# SELINUXTYPE= can take one of three values:
#     targeted - Targeted processes are protected,
#     minimum - Modification of targeted policy. Only selected processes are protected.
#     MLs - Multi Level Security protection.
SELINUXTYPE=targeted

重启

reboot

oracle-database-ee-19c-1.0-1.x86_64.rpmoracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm上传到/opt

二. 依赖安装

安装oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

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

三. 安装配置Oracle 19c

安装Oracle 19c

yum -y localinstall /opt/oracle-database-ee-19c-1.0-1.x86_64.rpm

初始化Oracle数据库(时间较长)

/etc/init.d/oracledb_ORCLCDB-19c configure

配置环境变量

却换到oracle用户

su - oracle

添加环境变量

vi /home/oracle/.bash_profile

# .bash_profile# Get the aliases and functionsif [ -f ~/.bashrc ];
     then        . ~/.bashrcfi# User specific environment and startup programsPATH=$PATH:$HOME/.local/bin:$HOME/binexport PATHexport ORACLE_HOME=/opt/oracle/product/19c/dbhome_1export PATH=$PATH:/opt/oracle/product/19c/dbhome_1/binexport ORACLE_SID=ORCLCDB

使环境变量生效

source /home/oracle/.bash_profile

登陆数据库

SQLplus / as sysdba

修改system密码为123456

alter user system identified by 123456;

退出数据库

exit;

四. 设置数据库监听自启动

修改/etc/oratab文件NY

vi /etc/oratab

# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# A colon, ':', is used as the field terminator.  A new line terminates
# the entry.  Lines beginning with a pound sign, '#', are comments.
#
# Entries are of the form:
#   $ORACLE_SID:$ORACLE_HOME:N|Y> :
#
# The First and second fields are the system identifier and home
# directory of the database respectively.  The third field indicates
# to the dbstart utility that the database should , "Y", or should not,
# "N", be brought up at system boot time.
#
# Multiple entries with the same $ORACLE_SID are not Allowed.
#
#
ORCLCDB:/opt/oracle/product/19c/dbhome_1:Y

/etc/rc.local中添加需执行的命令

su root # 却换为root用户
vi /etc/rc.local

#!/bin/bash# THIS FILE IS ADDED FOR COMPATIBILITY PURPOSES## It is highly advisable to create own systemd services or udev rules# to run scripts during boot instead of using this file.## In contrast to previous versions due to parallel execution during boot# this script will NOT be run after all other services.## Please note that you must run 'chmod +x /etc/rc.d/rc.local' to ensure# that this script will be executed during boot.touch /VAR/lock/subsys/localsu - oracle -c 'lsnrctl start'su - oracle -c 'dbstart'

修改$ORACLE_HOME/bin/dbstart文件,修改ORACLE_HOME_LISTNER=$ORACLE_HOME

vi $ORACLE_HOME/bin/dbstart

$ORACLE_HOME/bin/dbstart 文件局部

...#####################################LOGMSG="logger -puser.alert -s "trap 'exit' 1 2 3# for script tracingcase $ORACLE_TRACE in  T) set -x ;
    ;
esac# Set path if path not set (if called From /etc/rc)SAVE_PATH=/bin:/usr/bin:/etc:${
PATH}
     ;
     export PATHSAVE_LLP=$LD_LIBRARY_PATH# First argument is used to bring up Oracle Net ListenerORACLE_HOME_LISTNER=$ORACLE_HOMEif [ ! $ORACLE_HOME_LISTNER ];
     then  echo "Since ORACLE_HOME is not set, cannot auto-start Oracle Net Listener."  echo "usage: $0 ORACLE_HOME"else...

设置CentOS7,8开机执行/etc/rc.local文件(CentOS7,8开机不执行/etc/rc.local文件)

/etc/rc.d/rc.local 添加 可执行权限

chmod a+x /etc/rc.d/rc.local

将 rc-local 服务设置成开机启动(默认状态是 static,会被其他service服务调用执行。不过还是修改一下,以防那个服务被停用就牵连了)

systemctl enable rc-local

重启,用sqldeveloper链接,验证是否成功

reboot

删除/optoracle-database-ee-19c-1.0-1.x86_64.rpmoracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

rm /opt/oracle-database-ee-19c-1.0-1.x86_64.rpm /opt/oracle-database-preinstall-19c-1.0-1.el7.x86_64.rpm

到此这篇关于CentOS7下Oracle19c rpm安装过程的文章就介绍到这了,更多相关Oracle19c rpm安装内容请搜索以前的文章或继续浏览下面的相关文章希望大家以后多多支持!

您可能感兴趣的文章:
  • OL7.6上RPM方式安装Oracle 19c的教程
  • RPM包方式安装Oracle21c的方法详解

声明:本文内容由网友自发贡献,本站不承担相应法律责任。对本内容有异议或投诉,请联系2913721942#qq.com核实处理,我们将尽快回复您,谢谢合作!


若转载请注明出处: CentOS7下Oracle19c rpm安装过程
本文地址: https://pptw.com/jishu/631734.html
Oracle以逗号分隔的字符串拆分为多行数据实例详解 oracle连接ODBC sqlserver数据源的详细步骤

游客 回复需填写必要信息