RedHat Linux下Oracle啟動指令碼的建立 dbstart oracle8.1.6
來源:互聯網
上載者:User
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
來源:奧索