1 首先修改/etc/oratab文件添加如下行:
ycr:/u01/app/oracle/product/12.1.0/dbhome_1:Y

关于/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.
#
#
ycr:/u01/app/oracle/product/12.1.0/dbhome_1:Y
上面三个参数的意义分别为,实例名、ORACLE HOME、是否允许使用dbstart启动数据库

2 修改文件/etc/rc.d/rc.local,添加如下行:
su oracle -lc "/u01/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl start"
su oracle -lc "/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbstart"

关于rc.local解释如下:
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
su oracle -lc "/u01/app/oracle/product/12.1.0/dbhome_1/bin/lsnrctl start"
su oracle -lc "/u01/app/oracle/product/12.1.0/dbhome_1/bin/dbstart"

/etc/rc.d/rc.local做为初始化脚本中,的最后一个随开机启动。

RedHat(Linux) Oracle数据库设置开机自启动的更多相关文章

  1. linux下Oracle数据库实例开机自启动设置

    linux下数据库实例开机自启动设置 1.改动/oratab [root@org54 ~]# vi/etc/oratab     --把N改为Y,例如以下提示 # This file is used ...

  2. 配置Oracle数据库的开机自启动

    每当数据库服务器重启后,都要重新启动数据库的监听和实例,特别是在服务器断电重启.例行维护性的场景下.能否像Windows服务器一样,让实例和监听随着服务的启动而启动呢?答案当然是肯定的,我们可以利用O ...

  3. Linux服务器,服务管理--systemctl命令详解,设置开机自启动

    Linux服务器,服务管理--systemctl命令详解,设置开机自启动 syetemclt就是service和chkconfig这两个命令的整合,在CentOS 7就开始被使用了. 摘要: syst ...

  4. CentOS 6下 Oracle11gR2 设置开机自启动

    [1] 更改/etc/oratab # This file is used by ORACLE utilities. It is created by root.sh # and updated by ...

  5. 设置开机自启动VirtualBox虚拟机系统

    如果常用VirtualBox虚拟机系统的话,设置个随开机启动也是很方便的.不需要打开VirtualBox窗口,直接就是系统启动了. 又继续上网搜索学习了.(设置开机自启动VirtualBox虚拟机系统 ...

  6. Linux中如何设置服务自启动?

    转自:Linux中如何设置服务自启动? 有时候我们需要Linux系统在开机的时候自动加载某些脚本或系统服务,主要用三种方式进行这一操作: ln -s             在/etc/rc.d/rc ...

  7. Linux 系统设置sh文件开机自启动

    工作中有一个linux下的服务需要启动,但是机器总是断电,导致需要反复启动,找了一下开机自启动的方法,解决了这个问题.Linux设置开机自启动非常简单,只要找到rc.local文件,将你需要自启动的文 ...

  8. Ubuntu14.04设置开机自启动脚本

    方法一.编辑rc.loacl脚本  Ubuntu开机之后会执行/etc/rc.local文件中的脚本,所以我们可以直接在/etc/rc.local中添加启动脚本.在 exit 0 前面添加好脚本代码, ...

  9. linux下配置tomcat开机自启动

    Linux下配置tomcat开机自启动   1.写一个tomcat脚本,内容如下,设置其权限为755,放在/etc/init.d/目录下 #!/bin/bash## /etc/init.d/tomca ...

随机推荐

  1. Selenium+excel实现参数化自动化测试

    使用到的技术:POI对excel的解析.selenium自动化测试.junit 测试用例:登陆www.1905.com执行登陆-退出的操作 执行步骤: 1.首先创建一个excel,里面有用户名和密码列 ...

  2. windows下安装node环境,以及grunt试水笔记

    grunt,当下前端界知名度最高的工作流处理工具. 在一线的互联网公司,它早已经被用烂了,而我真正接触,是在去年年底... 期间还因为内心太杂分心玩乐而荒废学途,以致到最近才重拾学业,在这里BS一下自 ...

  3. PyCharm鼠标右键不显示Run unittest方法

    PyCharm鼠标右键不显示Run unittest方法 PyCharm是一个用来写python代码的IDE,很好用.在其中建立了unittest类后,鼠标点击某个test方法后,菜单中会显示Run ...

  4. Android新手常见问题(一)

    [1]AAPT2 error: check logs for details File->Settings->Build->Gradle一看path里有中文 最根本的原因是因为use ...

  5. C# Unix时间戳转换[转载]

    原文地址: C# Unix时间戳转换 遇到Unix时间戳转换的问题,遂记录下来. Unix时间戳转DateTime string UnixTime = "1474449764"; ...

  6. 了解下C#异常时的输出

    Sample Code: try { string re = "1.1".Substring(1,4); } catch (Exception ex) { logger.Error ...

  7. angular 与 layer 集成过程

    layer 的提示框和弹层确实也好用,在使用angular的前提下,使用layer遇到诸多麻烦,记录下来. 在类型是1页面层,主要问题在遮罩方面,造成无法编辑. 开始:引入layer 样式,angul ...

  8. ssh登录实现

    工程目录 配置文件详解 Spring的applicationContext.xml文件 <span ><?xml version="1.0" encoding=& ...

  9. IntelliJ IDEA常用配置

    1:IDEA同时打开多个项目: 选择菜单File–Setting-General--->右侧Project Opening选择第一个Open project in new window: 接下来 ...

  10. git记住提交密码的技巧

    修改.git包里面的config文件,添加 [credential] helper = store