ITPub博客

首页 > 数据库 > Oracle > Linux 下Oracle 开机自启动 与 oratab, dbstart 脚本 说明

Linux 下Oracle 开机自启动 与 oratab, dbstart 脚本 说明

Oracle 作者:哇哈哈825 时间:2014-05-08 09:28:47 0 删除 编辑
/etc/oratab说明


直接使用cat 查看这个文件:


gg1:/home/Oracle> cat /etc/oratab  
#  
   
# This file is used by ORACLEutilities.  It is created by root.sh  
# and updated by the Database ConfigurationAssistant when creating  
# a database.  
   
# A colon, ':', is used as the fieldterminator.  A new line terminates  
# the entry.  Lines beginning with a pound sign, '#', arecomments.  
#  
# Entries are of the form:  
#  $ORACLE_SID:$ORACLE_HOME::  
#  
# The first and second fields are thesystem identifier and home  
# directory of the databaserespectively.  The third filed indicates  
# to the dbstart utility that the databaseshould , "Y", or should not,  
# "N", be brought up at systemboot time.  
#  
# Multiple entries with the same$ORACLE_SID are not allowed.  
#  
#  
gg1:/u01/app/oracle/product/11.2.0.3/db_1:N  
这里是我测试环境上的文件,在这个注释里面,对这个文件讲的比较清楚。/etc/oratab 由root.sh 脚本创建,在用DBCA 创建实例时也会更新这个文件。


当$ORACLE_SID:$ORACLE_HOME: 设置为Y时,允许实例自启动,当设置为N时,则不允许自启动。 这个文件里的配置仅仅起一个开关的作用,其并不会具体的执行启动和关闭,具体的操作由$ORACLE_HOME/bin/dbstart和dbshut 脚本来实现。 这2个脚本在执行时会检查/etc/oratab 文件里的配置,为Y时才能继续执行。


所以配置数据库自启动和关闭的步骤如下:


(1)    配置/etc/oratab


(2)    修改$ORACLE_HOME/bin/dbstart和dbshut,并将其添加到/etc/rc(.local) 文件中。


这里是使用oracle 自带的dbstart 和dbshut脚本,如果使用自己写的脚本来启动或关闭DB 就不需要关心这个文件的设置了。

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29635878/viewspace-1156444/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-04-30

  • 博文量
    43
  • 访问量
    46137