免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
123
最近访问板块 发新帖
楼主: noise
打印 上一主题 下一主题

如何使Oracle10g在HPUX11下开机自动启动关机自动关闭?! [复制链接]

论坛徽章:
0
21 [报告]
发表于 2006-09-15 14:59 |只看该作者
原帖由 blue_stone 于 2006-9-15 12:54 发表
HP-UX的默认运行级别是3, 启动过程中将运行/sbin/rc3.d下的所有脚本,不过不是以start作为参数来运行这个脚本(和linux不太一样), 如果init 2然后再init 3则会以start参数来运行所有脚本


没看明白,我这样写对不对:


守护程序,/etc/rc.config.d/Oracle:

#!/sbin/sh#
# Oracle startup/shutdown Config
# Oracle:        Set to 1 Start Oracle10g
# OracleHome:        home dir for Oracle
#

Oracle=1
oracleHome=/opt/oracle/bin


启动脚本,/sbin/init.d/Oracle:

#!/sbin/sh

PATH=/usr/sbin:/usr/bin:/sbin:/opt/oracle/bin
export PAHT

rval=0

case Oracle in
'start_msg')
        # Emit a _short_ message relating to running this script with
        # the "start" argument; this message appears as part of the checklist.
        echo "Starting the Oracle 10g"
        ;;

'stop_msg')
        # Emit a _short_ message relating to running this script with
        # the "stop" argument; this message appears as part of the checklist.
        echo "Stopping the Oracle 10g"
        ;;

'start')

        # source the system configuration variables
        if [ -f /etc/rc.config.d/Oracle ] ; then
                . /etc/rc.config.d/Oracle
        else
                echo "ERROR: /etc/rc.config.d/Oracle file MISSING"
        fi

        # Check to see if this script is allowed to run...
        if [ "$Oracle" != 1 ]; then su - oracle -c "/opt/oracle/bin/dbstart"
                rval=2
        else

        # Execute the commands to start your subsystem
        :
        fi
        ;;

'stop')
        # source the system configuration variables
        if [ -f /etc/rc.config.d/Oracle ] ; then
                . /etc/rc.config.d/Oracle
        else
                echo "ERROR: /etc/rc.config.d/Oracle file MISSING"
        fi

        # Check to see if this script is allowed to run...
        if [ "$Oracle" != 1 ]; then su - oracle -c "/opt/oracle/bin/dbshut"
                rval=2
        else
        :
        # Execute the commands to stop your subsystem

        fi
        ;;

*)
        echo "usage: $0 {start|stop|start_msg|stop_msg}"
        rval=1
        ;;
esac

exit $rval

[ 本帖最后由 noise 于 2006-9-15 15:23 编辑 ]

论坛徽章:
0
22 [报告]
发表于 2006-09-15 15:21 |只看该作者
/sbin/rc3.d/S999Oracle start和/sbin/rc2.d/K100Oracle stop都测试通过了,重新启动试一下应该就是他了。

论坛徽章:
0
23 [报告]
发表于 2006-09-15 15:25 |只看该作者
感谢各位的帮忙,数据库可以正常启动和关闭了。

论坛徽章:
0
24 [报告]
发表于 2007-03-07 14:37 |只看该作者
'start')
       # source the system configuration variables
        if [ -f /etc/rc.config.d/Oracle ] ; then
                . /etc/rc.config.d/Oracle
        else
                echo "ERROR: /etc/rc.config.d/Oracle file MISSING"
        fi

        # Check to see if this script is allowed to run...
        if [ "$Oracle" != 1 ]; then su - oracle -c "/opt/oracle/bin/dbstart"
                rval=2
        else


在 /etc/rc.config.d/Oracle  中设置的是Oracle=1时,才启动dbstart,
但代码中却是 "$Oracle" 不等于1 时,启动dbstart ?? 为什么???
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP