Oracle 10g 11g在Redhat linux平台下不能自动关闭

平台:Redhat AS  4、5
数据库版本:Oracle 10g 11g

       今天重启服务器时候,突然发现数据库不能随服务关闭自动关闭,直接被killall了。原来一直没注意 ,自动启动脚本还有这毛病。
       经过对比检查,发现能自动启动并正常关闭的数据库的服务每次启动都会在/var/lock/subsys目录中生成跟服务名字相同的一个lock文件。
      于是,编辑启动脚本如下:

#!/bin/sh
# chkconfig: 2345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.

ORA_HOME= 你的Oracle_HOME
ORA_OWNER= 你的ORA_OWNER

if [ ! -f $ORA_HOME/bin/dbstart ]
then
    echo "Oracle startup: cannot start"
    exit
fi

case "$1" in
    'start')
        # Start the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
        touch /var/lock/subsys/oracle
        ;;
    'stop')
        # Stop the Oracle databases:
        # The following command assumes that the oracle login
        # will not prompt the user for any values
        su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
        rm -rf /var/lock/subsys/oracle
        ;;
esac

    带颜色部分为添加内容。

     

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值