1. 方法简介:

使用systemd 来进行 oracle数据库的启动和关闭操作. 使用的脚本为 lsnrctl和dbstart

2. 修改事项.

需要先修改一下 oracle 的启动脚本配置:

vim /etc/oratab

将里面 最后一句话设置从N 修改为Y 允许启动

ORA19C:/opt/oracle/product/19c/dbhome_1:Y

注意这个文档说明:

# 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.

3. 然后设置一下 数据库的启动命令

vim /usr/bin/oracle.sh

增加的内容为:
#! /bin/bash
# script For oracle19c.service
/opt/oracle/product/19c/dbhome_1/bin/lsnrctl start
/opt/oracle/product/19c/dbhome_1/bin/dbstart /opt/oracle/product/19c/dbhome_1

然后设置这个文件的读写权限

chmod  /usr/bin/oracle.sh

4. 设置一个 oracle19c.service

vim /etc/systemd/system/oracle19c.service

编辑添加内容为:

[Unit]
Description=Oracle19c
After=syslog.target network.target

[Service]
LimitMEMLOCK=infinity
LimitNOFILE=65535
Type=oneshot
RemainAfterExit=yes
User=oracle
Environment="ORACLE_HOME=/opt/oracle/product/19c/dbhome_1"
ExecStart=/usr/bin/oracle.sh

[Install]
WantedBy=multi-user.target

5. 设置开机自动启动

systemctl enable oracle19c

6. 重启测试.

成功.

CentOS 7.6 RPM 方式安装Oracle19c 后 使用 systemd 的方式设置开机自动启动Oracle数据库的更多相关文章

  1. Linux使用curl 方式安装docker-compose 后执行docker-compose version 检查安装是否成功时出错的解决办法

    0x0.缘起: 今天在一台新的Fedora 25上按照官方文档,使用curl方式安装 docker-compose后,验证是否安装成功时出错: 安装时使用的命令为; curl -L https://g ...

  2. centos下安装memcached并设置开机自动启动-两种方法

    方法一: 安装memcachedyum install memcached 启动服务并初始化service memcached start -p 11211 -l 127.0.0.1 -d 设置mem ...

  3. CentOS设置开机自动启动某服务

    CentOS设置开机自动启动某服务   这里以启动sshd服务为例:   查看sshd是否已经是系统服务:   # chkconfig --list |grep sshd 会显示:  sshd     ...

  4. CentOS 7.6 RPM方式安装Oracle19c的过程

    1. 下载需要的安装包: 1.1 preinstall http://yum.oracle.com/repo/OracleLinux/OL7/latest/x86_64/getPackage/orac ...

  5. centos/rhel 6.5(更新至centos 7)下rabbitmq安装(最简单方便的方式)

    vim /etc/hosts 增加 127.0.0.1 hostname 不然启动的时候可能会报如下错误: [root@devel2 rabbitmq]# rabbitmq-server ERROR: ...

  6. centos安装redis,并设置开机自动启动项

    安装Redis 1.下载.解压.编译.安装 下载.解压 https://redis.io/download 官网下载redis的*.tar.gz安装包.版本可根据自己需要下载. tar -zxvf r ...

  7. 在Linux环境安装redis步骤,且设置开机自动启动redis

    最近在linux环境安装了redis学习,目前已经安装成功且设置开机即启动状态,我把步骤流程记录了下来,分享给需要的小伙伴. 1.我在/usr/local/localsoftware/目录下创建了一个 ...

  8. rpm方式安装MySQL后在命令行登录报错:ERROR 1045 (28000): Unknown error 1045

    1.通过https://mirrors.tuna.tsinghua.edu.cn镜像源安装了MySQL5.7.22 rpm -ivh --force --nodeps https://mirrors. ...

  9. linux(centos6.9)下rpm方式安装mysql后mysql服务无法启动

    以下两种方式启动都报错:启动失败: [root@node03 ~]# service mysqld startMySQL Daemon failed to start.Starting mysqld: ...

随机推荐

  1. jvm——metaspace代替永久代

    https://mp.weixin.qq.com/s?__biz=MzIzNjI1ODc2OA==&mid=2650886860&idx=1&sn=f8bc6ab03d7a07 ...

  2. vue和electron做的聊天应用表情包处理

    表情包库: https://apps.timwhitlock.info/emoji/tables/unicode <template> <div @click.stop> &l ...

  3. java+web+大文件上传下载

    文件上传是最古老的互联网操作之一,20多年来几乎没有怎么变化,还是操作麻烦.缺乏交互.用户体验差. 一.前端代码 英国程序员Remy Sharp总结了这些新的接口 ,本文在他的基础之上,讨论在前端采用 ...

  4. noip模拟题 Market

    题面描述: 数据范围: Solution: 我们发现\(v\)很小,但是\(M\)很大,考虑转化一下一般的背包 我们用\(f[v]\)来表示拿到价值为\(v\)的物品需要付出的最少代价,特别的,当\( ...

  5. 序列式容器————forward_list

    单链表的形式存储元素.forward_list 的模板定义在头文件 forward_list 中.fdrward_list 和 list 最主要的区别是:它不能反向遍历元素:只能从头到尾遍历. for ...

  6. LNK1104 无法打开文件“proj.lib”

    两种可能: 1.proj.lib不存在 2.proj.lib不符合编译的debug(release)版本

  7. JAVA语言课堂测试源代码及使用截图

    1源代码 第一部分 package 开学测试.java;class ScoreInformation {String stunumber;String name;double mathematicss ...

  8. (77)一文了解Redis

    为什么我们做分布式使用Redis? 绝大部分写业务的程序员,在实际开发中使用 Redis 的时候,只会 Set Value 和 Get Value 两个操作,对 Redis 整体缺乏一个认知.这里对  ...

  9. 综合KPI报表历史明细数据查询

    一.综合计划部KPI明细数据查询--xigu用户要求:需显示第三季度,即789三个月的明细数据解决方法:1.查看SSISC:\Users\Administrator\Documents\Visual ...

  10. (四)mysql -- 常用函数

    今天get一个,先记录一下 以后慢慢补充~ 将varchar转换成int 例如:select * from tb_1 order by cast(sport_sum as unsigned integ ...