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


一./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
  • 下一页

相关内容