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做为初始化脚本中,的最后一个随开机启动。

最新文章

  1. iOS网络3—UIWebView与WKWebView使用详解
  2. 64位 SQL Server2008链接访问Oracle 过程汇总解决方法记录
  3. 用SYS_CONNECT_BY_PATH进行层级查询时的排序问题
  4. Servlet、Filter和Listener
  5. 「2014-2-6」TokuMX and MongoDB related materials collection
  6. 编译安装lnmp
  7. [转]用Objective-C实现简单的数学字符串公式的计算
  8. elasticsearch 使用事项
  9. 【bzoj1552】[Cerc2007]robotic sort
  10. ant在持续集成的应用
  11. 3.HttpSession
  12. Java开发人员必须掌握的两个Linux魔法工具(四)
  13. 20155219 2016-2017-2 《Java程序设计》第5周学习总结
  14. Comparing Code Playgrounds Codepen, JSFiddle, JS Bin, Dabblet, CSS Deck, and Liveweave
  15. css3实现卡牌旋转与物体发光效果
  16. 机器学习实战(Machine Learning in Action)学习笔记————09.利用PCA简化数据
  17. OKEx货币对价格数量长度及精度
  18. 使用IDEA 搭建SpringMVC +Easyui 实现最简单的数据展示功能
  19. PHP标准库SPL
  20. java学习笔记—Servlet技术(11)

热门文章

  1. FFmpeg的H.264解码器源代码简单分析
  2. Bash编程(3) 命令行解析与扩展
  3. 通过IntelliJ IDEA忽略掉不需要提交到github的文件
  4. Map集合遍历的4种方法
  5. 理解 Azure 虚拟机的性能监视
  6. .net EF框架 MySql实现实例
  7. 2017年11月27日 C#MDI窗体创建&amp;记事本打印&amp;记事本查找、自动换行
  8. Java内存区域和对象的创建
  9. 记一次使用cmd执行java文件遇到的坑...包括“使用java命令运行class文件提示“错误:找不到或无法加载主类“的问题”
  10. springboot自定义异常