红帽启动oracle,RedHat Linux下Oracle启动脚本的建立 dbstart oracle8.1.6-数据库专栏,ORACLE...

redhat linux下oracle启动脚本的建立

2001-06-05 8:25

发布者:crystal 阅读次数:102 一、修改$oracle_home/bin/dbstart脚本

首先测试你的$oracle/bin/dbstart脚本,如果能正常启动oracle,请跳到第二部分。

本人运行环境为redhat7.1+oracle8.1.6,发现dbstart脚本有问题,不能得到当前运行的oracle的版本号。编辑dbstart,找到

status=1

if [ “$version” = “8.1” ]

在之前加上

version=”8.1″

二、建立/etc/init.d/oracle脚本如下:#!/bin/bash

#

# oracle this shell script takes care of starting and stopping

# the mysql subsystem (mysqld).

#

# chkconfig: – 90 10

# description: oracle database server.

# processname: oracle

ora_home=/home/oracle

ora_owner=oracle

prog=”oracle”

# source function library.

. /etc/rc.d/init.d/functions

if [ ! -f $ora_home/bin/dbstart ]

then

echo “oracle startup: cannot start”

exit

fi

start(){

su – $ora_owner -c $ora_home/bin/dbstart >/dev/null 2>&1 &

ret=$?

if [ $ret -eq 0 ]; then

action $”starting $prog: ” /bin/true

else

action $”starting $prog: ” /bin/false

fi

[ $ret -eq 0 ] && touch /var/lock/subsys/oracled

return $ret

}

stop(){

su – $ora_owner -c $ora_home/bin/dbshut >/dev/null 2>&1

ret=$?

if [ $ret -eq 0 ]; then

action $”stopping $prog: ” /bin/true

else

action $”stopping $prog: ” /bin/false

fi

[ $ret -eq 0 ] && rm -f /var/lock/subsys/oracled

return $ret

}

restart(){

stop

start

}

# see how we were called.

case “$1” in

start)

start

;;

stop)

stop

;;

restart)

restart

;;

condrestart)

condrestart

;;

*)

echo $”usage: $0 {start|stop|restart}”

exit 1

esac

三、运行命令chkconfig –add oracle,注册系统服务,然后就可以用ntsysv命令来管理你的oracle服务了。

四、可以到

http://fancao.oso.com.cn/script/dbstart

http://fancao.oso.com.cn/script/oracle

下载本文所提及文件。

作者:凡草0515

来源:奥索

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值