Chinaunix首页 | 论坛 | 博客
  • 博客访问: 730682
  • 博文数量: 140
  • 博客积分: 5097
  • 博客等级: 大校
  • 技术积分: 991
  • 用 户 组: 普通用户
  • 注册时间: 2006-01-05 19:13
文章分类

全部博文(140)

文章存档

2018年(1)

2015年(5)

2014年(5)

2013年(2)

2011年(16)

2010年(6)

2009年(9)

2008年(45)

2007年(26)

2006年(25)

分类: Oracle

2010-07-06 18:26:44


#!/bin/sh
# description: Oracle auto start-stop script.
# chkconfig: - 20 80
#
# 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=/u02/app/oracle/product/11.2.0/db_1
ORA_OWNER=oracle

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"
        #su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
        su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole"
        ;;
'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/lsnrctl stop"
        su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
        su - $ORA_OWNER -c "$ORA_HOME/bin/emctl stop dbconsole"
        ;;
'restart')
        $0 stop
        $0 start
        ;;
        *)
        echo $"Usage: $0 {start|stop|restart}"
        exit 1
        ;;
esac
exit $?


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