Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1789336
  • 博文数量: 1647
  • 博客积分: 80000
  • 博客等级: 元帅
  • 技术积分: 9980
  • 用 户 组: 普通用户
  • 注册时间: 2008-10-13 15:15
文章分类

全部博文(1647)

文章存档

2011年(1)

2008年(1646)

我的朋友

分类:

2008-10-28 18:16:33

一、修改$ORACLE_HOME/bin/dbstart脚本

首先你的$ORACLE/bin/dbstart脚本,如果能正常启动,请跳到第二部分。
本人运行环境为RedHat7.1+8.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服务了。

四、可以到


本文所提及文件。
作者:凡草0515
【责编:Peng】

--------------------next---------------------

阅读(241) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~