直接使用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时,则不允许自启动。
(1) 配置/etc/oratab
(2) 修改$ORACLE_HOME/bin/dbstart和dbshut,并将其添加到/etc/rc(.local) 文件中。
这里是使用oracle 自带的dbstart 和dbshut脚本,如果使用自己写的脚本来启动或关闭DB 就不需要关心这个文件的设置了。