学习自:

http://blog.csdn.net/condywl/article/details/57129696

1. 在root用户下进行修改 配置文件 /etc/oratab

vim /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.
#
#
orcl:/u01/app/oracle/product/18.1./dbhome_1:Y

根据信息 增加后者是修改的一行信息为:

orcl:/u01/app/oracle/product/18.1./dbhome_1:Y

2. 切换到oracle用户,并且进入到oracle的home路径下

su - oracle
cd $ORACLE_HOME/bin

3. 编辑oracle home目录下的dbstart 以及 dbshut的文件

主要修改点:

将多个 $1 修改为 $ORACLE_HOME

以及将 ORACLEBASEHOME_EXEC修改为如下.

ORABASEHOME_EXEC=$ORACLE_HOME/bin

在bin目录下执行操作测试

./dbshut 以及 ./dbstart 验证 能够正常开启或者关闭数据库

验证lsnrctl 下status以及 oracle  sqlplus / as sysdba 下面都可用

4. 修改开机启动脚本.

切换到root用户

su - root 

vim /etc/rc.d/rc.local
#这里需要给rc.local增加可执行权限
chmod +x /etc/rc.d/rc.local
systemd 之后 linux 应该已经不主要支持rc.local下面的启动方式了.

在文档的最后增加一行

su - oracle -lc dbstart

5. reboot linux 验证 oracle可以自动启动起来.

oracle 18c centos7 设置开机自动启动Oracle的更多相关文章

  1. CentOS 7.6 RPM 方式安装Oracle19c 后 使用 systemd 的方式设置开机自动启动Oracle数据库

    1. 方法简介: 使用systemd 来进行 oracle数据库的启动和关闭操作. 使用的脚本为 lsnrctl和dbstart 2. 修改事项. 需要先修改一下 oracle 的启动脚本配置: vi ...

  2. 在RHEL5.4下设置开机自动启动ORACLE 11G

    以root身份登录,创建启动服务脚本 #cd /etc/rc.d/init.d #touch oracle11g #chmod a+x oracle11g 编辑启动脚本脚本文件(oracle11g), ...

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

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

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

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

  5. Mongodb 启动关闭脚本并设置开机自动启动Mongodb

    配置文件内容:[root@yoon etc]# cat mongod.conf logpath=/export/log/mongodb.loglogappend=truefork = truedbpa ...

  6. VMware ESXi 6.7服务器设置开机自动启动虚拟机

    VMware ESXi 6.7服务器设置开机自动启动虚拟机,具体操作步骤如下 1.登陆到VMware ESXi 6.7  web 界面 2.导航器-->主机-->管理  将自动启动修改为 ...

  7. Linux开机自动启动ORACLE设置

    1.安装好Oracle数据库后: 执行 dbstart和dbshut会提示: [oracle@oracle11g ~]$ dbstartORACLE_HOME_LISTNER is not SET, ...

  8. linux 系统下开机自动启动oracle 监听和实例 (亲测有效)

    [oracle@oracle11g ~]$ dbstartORACLE_HOME_LISTNER is not SET, unable to auto-start Oracle Net Listene ...

  9. Centos7下源编译安装Postgresql 并设置开机自动启动postgresql.serivce 服务相关研究

    编写开机自动启动服务脚本: # cat >> /usr/lib/systemd/system/postgresql.service >> EOF [Unit] Descript ...

随机推荐

  1. Discrete Logging ZOJ - 1898 (模板题大小步算法)

    就是求Ax三B(mod C)当C为素数时 #include<cstdio> #include<cstring> #include<cmath> #include&l ...

  2. day16 Python map函数

    num_l=[1,2,10,5,3,7] #lambda x:x+1 # def add_one(x): # return x+1 #lambda x:x+1 # def reduce_one(x): ...

  3. MP实战系列(一)之入门框架搭建和使用

    mybatis plus官网:https://github.com/baomidou/mybatis-plus 上面有对应的实际例子,直接导入即可用. mybatis plus官方的怎么介绍,我就不在 ...

  4. 深入浅出的webpack构建工具---DllPlugin DllReferencePlugin提高构建速度(七)

    阅读目录 一:什么是DllPlugin 和 DllReferencePlugin?作用是什么? 二:在项目中如何使用 DllPlugin 和 DllReferencePlugin? 三:DllPlug ...

  5. ASP.NET Core中如果Response.HasStarted已经为true,就不能更改Response.Cookies和Response.Headers等属性的值了

    最近我在ASP.NET Core中做了一个中间件CustomizedMiddleware,要说该中间件的功能也很简单,其实就是往HttpResponse中添加一个Cookie而已,但是我将添加Cook ...

  6. NOIP常见模板集合

    Preface 这篇博客记录的是我联赛前虽然只有两天了的打板子记录. 只求真的能给我起到些作用吧,一般按照难度排序. 而且从这篇博客开始我会用H3的标题代替H4 为了节约篇幅,以下的代码一般均以cla ...

  7. centos7下/etc/rc.local文件里配置的开机启动项不执行的解决办法

    习惯于在/etc/rc.local文件里配置我们需要开机启动的服务,这个在centos6系统下是正常生效的.但是到了centos7系统下,发现/etc/rc.local文件里的开机启动项不执行了!仔细 ...

  8. Codeforces Round #503 (by SIS, Div. 2)-C. Elections

    枚举每个获胜的可能的票数+按照花费排序 #include<iostream> #include<stdio.h> #include<string.h> #inclu ...

  9. vue自定义公共组件components||在vue中,解决修改后的数据不能渲染到dom上的bug

    //主页面框架用来嵌入:Main.vue <el-col :span="24" > * { margin: 0; padding: 0; } html { width: ...

  10. 12.25daily_scrum

    今天是圣诞节,大家在度过了一个愉快的节日同时,同时也收到了最好的圣诞礼物,就是调试工作已经进入尾声,接下来我们组的主要任务就是M2阶段的总结了.为了更好的做好M2阶段的收官工作,我们组决定分配相当的一 ...