/etc/oratab檔案的內容:
# This file is used by ORACLE utilities. It is created by root.sh
# and updated by the Database Configuration Assistant when creating
# a database.
# 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::
#
# The first and second fields are the system identifier and home
# directory of the database respectively. The third filed 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.
#
#
oradb:/u01/app/oracle/product/11.2.0/db_1:N
-----------------------------------------------------------------------------------------
這個檔案是在建立資料庫執行個體時建立的,需要用root使用者運行root.sh,如果忘記運行在自啟動和關閉時會失敗,錯誤資訊:"/etc/oratab" is not accessible。
它記錄主機中有多少個資料庫。
在$ORACLE_HOME/bin目錄下的$ORACLE_HOME/bin/dbstart和$ORACLE_HOME/bin/dbshut需要調用/etc/oratab檔案,如果不存在,dbstart和dbshut將失敗。
etc/oratab 格式為: SID:ORACLE_HOME:AUTO
如果需要自動啟動資料庫,則將AUTO設為Y,在調用dbstart命令才生效。dbstart根據/etc/oratab中的配置來啟動相應的資料庫,選項只是能不能用$ORACLE_HOME/bin/dbstart和$ORACLE_HOME/bin/dbshut來啟動和關閉資料庫的開關。
$ORACLE_SID:$ORACLE_HOME:<N|Y>
說明:第一個地區的值是sid,第二個地區的值是資料庫主目錄,第三個地區的值Y或N指定你是否想要dbstart和dbshut指令碼啟動並關閉資料庫
如果不用dbstart指令碼啟動資料庫,而是用自己的指令碼來啟動,根本不需要oratab檔案。