Linux 下Oracle 開機自啟動 與 oratab, dbstart 指令碼 說明

來源:互聯網
上載者:User

一./etc/oratab說明

直接使用cat 查看這個檔案:

  1. gg1:/home/Oracle> cat /etc/oratab  
  2. #  
  3.    
  4. # This file is used by ORACLEutilities.  It is created by root.sh  
  5. # and updated by the Database ConfigurationAssistant when creating  
  6. # a database.  
  7.    
  8. # A colon, ':', is used as the fieldterminator.  A new line terminates  
  9. # the entry.  Lines beginning with a pound sign, '#', arecomments.  
  10. #  
  11. # Entries are of the form:  
  12. #  $ORACLE_SID:$ORACLE_HOME:<N|Y|W>:  
  13. #  
  14. # The first and second fields are thesystem identifier and home  
  15. # directory of the databaserespectively.  The third filed indicates  
  16. # to the dbstart utility that the databaseshould , "Y", or should not,  
  17. # "N", be brought up at systemboot time.  
  18. #  
  19. # Multiple entries with the same$ORACLE_SID are not allowed.  
  20. #  
  21. #  
  22. gg1:/u01/app/oracle/product/11.2.0.3/db_1:N  

這裡是我測試環境上的檔案,在這個注釋裡面,對這個檔案講的比較清楚。/etc/oratab 由root.sh 指令碼建立,在用DBCA 建立執行個體時也會更新這個檔案。

當$ORACLE_SID:$ORACLE_HOME:<N|Y> 設定為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 就不需要關心這個檔案的設定了。

  • 1
  • 2
  • 3
  • 4
  • 下一頁

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.