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. 上传base64图片到七牛云前端遇到的坑

    介意前端普通引入七牛云SDk上传图片到七牛云需要多个js,所以才有了base64的上传方式,简化操作,(懒.) 七牛云官方文档如下 https://developer.qiniu.com/kodo/k ...

  2. [每日一讲] Python系列:列表与元组

    参考文档 https://docs.python.org/zh-cn/3.7/tutorial/introduction.html#lists """ DATA STRU ...

  3. 为什么要用setTimeout模拟setInterval ?

    setInterval有两个缺点: 使用setInterval时,某些间隔会被跳过: 可能多个定时器会连续执行: 在前一个定时器执行完前,不会向队列插入新的定时器(解决缺点一) 保证定时器间隔(解决缺 ...

  4. python导入包失败ModuleNotFoundError: No module named 'matplotlib.pyplot'; 'matplotlib' is not a package

    最近在看 python,在使用matplotlib进行绘图时,提示:ModuleNotFoundError: No module named 'matplotlib.pyplot'; 'matplot ...

  5. Linux基础教程 linux系统中的批量删除文件与空文件删除的命令介绍

    linux下面删除文件或者目录命令rm(remove): 兄弟连Linux培训 功能说明:删除文件或目录. 语 法:rm[-dfirv][--help][--version][文件或目录...] 补充 ...

  6. Java+超大文件上传

    之前仿造uploadify写了一个HTML5版的文件上传插件,没看过的朋友可以点此先看一下~得到了不少朋友的好评,我自己也用在了项目中,不论是用户头像上传,还是各种媒体文件的上传,以及各种个性的业务需 ...

  7. linux文件夹目录含义及用途

    /boot,存放linux启动文件和内核: /initrd,boot loader initialized RAM disk,就是由boot loader初始化的内存盘.在linux内核启动前,boo ...

  8. create-react-app 构建的项目使用释放配置文件 webpack 等等 运行 npm run eject 报错

    使用 git 提交一次记录即可正常 git add . git commit -m 'init' npm run eject

  9. matplotlib画图——条形图

    一.单条 import numpy as np import matplotlib.pyplot as plt N = 5 y1 = [20, 10, 30, 25, 15] y2 = [15, 14 ...

  10. ZXing使用详解与范例(C#)

    介绍 ZXing是一个开放源码的,用Java实现的多种格式的1D/2D条码图像处理库,它包含了联系到其他语言的端口.Zxing可以实现使用手机的内置的摄像头完成条形码的扫描及解码.(引自百度百科) 用 ...