RedHat(Linux) Oracle数据库设置开机自启动
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做为初始化脚本中,的最后一个随开机启动。
最新文章
- iOS网络3—UIWebView与WKWebView使用详解
- 64位 SQL Server2008链接访问Oracle 过程汇总解决方法记录
- 用SYS_CONNECT_BY_PATH进行层级查询时的排序问题
- Servlet、Filter和Listener
- 「2014-2-6」TokuMX and MongoDB related materials collection
- 编译安装lnmp
- [转]用Objective-C实现简单的数学字符串公式的计算
- elasticsearch 使用事项
- 【bzoj1552】[Cerc2007]robotic sort
- ant在持续集成的应用
- 3.HttpSession
- Java开发人员必须掌握的两个Linux魔法工具(四)
- 20155219 2016-2017-2 《Java程序设计》第5周学习总结
- Comparing Code Playgrounds Codepen, JSFiddle, JS Bin, Dabblet, CSS Deck, and Liveweave
- css3实现卡牌旋转与物体发光效果
- 机器学习实战(Machine Learning in Action)学习笔记————09.利用PCA简化数据
- OKEx货币对价格数量长度及精度
- 使用IDEA 搭建SpringMVC +Easyui 实现最简单的数据展示功能
- PHP标准库SPL
- java学习笔记—Servlet技术(11)
热门文章
- FFmpeg的H.264解码器源代码简单分析
- Bash编程(3) 命令行解析与扩展
- 通过IntelliJ IDEA忽略掉不需要提交到github的文件
- Map集合遍历的4种方法
- 理解 Azure 虚拟机的性能监视
- .net EF框架 MySql实现实例
- 2017年11月27日 C#MDI窗体创建&;记事本打印&;记事本查找、自动换行
- Java内存区域和对象的创建
- 记一次使用cmd执行java文件遇到的坑...包括“使用java命令运行class文件提示“错误:找不到或无法加载主类“的问题”
- springboot自定义异常