广告位联系
返回顶部
分享到

详解CentOS7下Oracle19c rpm安装过程

oracle 来源:转载 作者:秩名 发布时间:2021-07-11 08:03:02 人浏览
摘要

软件 下载地址 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-databas

软件 下载地址
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 firewalld
systemctl 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.rpm和oracle-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 functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH

export ORACLE_HOME=/opt/oracle/product/19c/dbhome_1
export PATH=$PATH:/opt/oracle/product/19c/dbhome_1/bin
export ORACLE_SID=ORCLCDB

使环境变量生效

source /home/oracle/.bash_profile

登陆数据库

sqlplus / as sysdba

修改system密码为123456

alter user system identified by 123456;

退出数据库

exit;

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

修改/etc/oratab文件N为Y

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/local

su - 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 tracing
case $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 PATH
SAVE_LLP=$LD_LIBRARY_PATH

# First argument is used to bring up Oracle Net Listener
ORACLE_HOME_LISTNER=$ORACLE_HOME
if [ ! $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

删除/opt下oracle-database-ee-19c-1.0-1.x86_64.rpm和oracle-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


版权声明 : 本文内容来源于互联网或用户自行发布贡献,该文观点仅代表原作者本人。本站仅提供信息存储空间服务和不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权, 违法违规的内容, 请发送邮件至2530232025#qq.cn(#换@)举报,一经查实,本站将立刻删除。

您可能感兴趣的文章 :

原文链接 : https://www.cnblogs.com/z212021/p/14989385.html
相关文章
  • Oracle中的Dual系统表介绍

    Oracle中的Dual系统表介绍
    这几天一直在研究Oracle,常常会用到Dual这个系统表,Dual表到底是一个什么表?带着疑问baidu了一下: Dual表是Oracle提供的最小的工作表(其
  • Oracle删除大量表记录操作介绍
    删除表数据操作 清空所有表记录: 1 TRUNCATE TABLE your_table_name; 或者批量删除满足条件的表记录: 1 2 3 4 5 6 7 BEGIN LOOP DELETE FROM your_table_name W
  • ORACLE中常用的几种正则表达式介绍

    ORACLE中常用的几种正则表达式介绍
    ORACLE正则表达式我基本用到的就一下几种,前四种最长用到 REGEXP_LIKE(source_char, pattern, match_parameter) REGEXP_SUBSTR(source_char, pattern, position, occur
  • SQL案例学习之字符串的合并与拆分方法介绍

    SQL案例学习之字符串的合并与拆分方法介绍
    字符串的合并 在Oracle中可能有多种实现方法,目前我已知的有两种,下面记录下这两种的实现: 字符串合并方法一: 实现SQL: 1 2 3 4 --方法
  • Oracle根据时间查询的一些常见情况汇总

    Oracle根据时间查询的一些常见情况汇总
    1. 查询时间段之内的数据 1 2 3 4 5 查询2021-01-01 至 2021-01- 02 的数据 SELECT * FROM t_table1 t WHERE t.d_time = to_date(2021-01-01 00:00:00, yyyy-mm-dd hh24:mi:ss)
  • oracle删除超过N天数据脚本的方法
    公司内做的项目是工厂内的,一般工厂内数据要求的是实时性,很久之前的数据可以自行删除处理,我们数据库用的oracle,所以就想着写一
  • oracle重置序列从0开始递增1
    oracle序列创建以后,如果想重置序列从 0 开始,逐渐递增1,可以采用如下存储过程: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 create or replace proce
  • 详解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
  • Oracle创建只读账号的方法

    Oracle创建只读账号的方法
    需求说明 现有数据库账号:HEPSUSR:具有完整权限,增删改查。 需要创建一个数据库账号:HTREADER,对HEPSUSR账号下所有的表具有只读权限。
  • 详解ORACLE数据库应用开发的三十个注意事项
    笔者及所在团队从2000年开始的CRM等系统开发,一直主要使用ORACLE数据库作为应用数据库,开发方式包括使用PLSQL编写存储过程/数据库函数
  • 本站所有内容来源于互联网或用户自行发布,本站仅提供信息存储空间服务,不拥有版权,不承担法律责任。如有侵犯您的权益,请您联系站长处理!
  • Copyright © 2017-2022 F11.CN All Rights Reserved. F11站长开发者网 版权所有 | 苏ICP备2022031554号-1 | 51LA统计