對/etc/oratab檔案的理解

來源:互聯網
上載者:User

/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檔案。

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.