`
cancer_sun
  • 浏览: 32163 次
  • 性别: Icon_minigender_1
社区版块
存档分类
最新评论

Linux下设置Oracle开机自启动

 
阅读更多

1、编辑oratab文件

[root@oracle ~]# vim /etc/oratab


# This file is used by ORACLE utilities.  It is created by root.sh
# and updated by either Database Configuration Assistant while creating
# a database or ASM Configuration Assistant while creating ASM instance.

# 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:<N|Y>:
#
# 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.
#
#
orcl:/u01/oracle/product/11.2.0/db_1:N
将该处的N该成Y,即:
orcl:/u01/oracle/product/11.2.0/db_1:Y

2、编辑/etc/rc.d/rc.local启动文件,添加数据库启动脚本dbstart,该文件必须使用root用户编辑

[root@oracle ~]# vim /etc/rc.d/rc.local
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local
su - oracle -lc /u01/oracle/product/11.2.0/db_1/bin/dbstart
su - oracle -lc "/u01/oracle/product/11.2.0/db_1/lsnrctl start"

3、编辑dbstart和dbshut文件

[root@oracle ~]# vim /u01/oracle/product/11.2.0/db_1/bin/dbstartORACLE_HOME_LISTNER=$1改成ORACLE_HOME_LISTNER=$ORACLE_HOME

[root@oracle ~]# vim /u01/oracle/product/11.2.0/db_1/bin/dbshutORACLE_HOME_LISTNER=$1改成ORACLE_HOME_LISTNER=$ORACLE_HOME
<script type="text/javascript"> $(function () { $('pre.prettyprint code').each(function () { var lines = $(this).text().split('\n').length; var $numbering = $('<ul/>').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i <= lines; i++) { $numbering.append($('<li/>').text(i)); }; $numbering.fadeIn(1700); }); }); </script>

版权声明:本文为博主原创文章,未经博主允许不得转载。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics