- 爱易网页
-
Linux
- linux上设置oracle开机自启动
日期:2014-05-16 浏览次数:20653 次
linux下设置oracle开机自启动
#!/bin/sh
#
# Copyright (C) 1998-2008 Oracle, Inc. All Rights Reserved.
#
# This script manages the services needed to run oracle software
# Basic support for IRIX style chkconfig
# chkconfig: 2345 99 01
# description: ORACLE 10g Server
ORACLE_HOME=/oracle/10g
ORACLE_BASE=/oracle
if [ ! -f $ORACLE_HOME/bin/dbstart ]
then
echo "ORACLE cannot start"
exit
fi
case "$1" in
'start')
echo "Starting Oracle Database..."
echo "-------------------------------------------------" >> /var/log/oracle
date +" %T %a %D : Starting Oracle Databasee as part of system up." >> /var/log/oracle
echo "-------------------------------------------------" >> /var/log/oracle
su - oracle -c "$ORACLE_HOME/bin/dbstart" >> /var/log/oracle
echo "Done."
echo "Starting Oracle EM Control ... "
echo "-------------------------------------------------" >> /var/log/oracle
date +" %T %a %D : Starting Oracle EM Control as part of system up." >> /var/log/oracle
echo "-------------------------------------------------" >> /var/log/oracle
su - oracle -c "$ORACLE_HOME/bin/emctl start dbconsole" >> /var/log/oracle
echo "Done."
echo ""
echo "-------------------------------------------------" >> /var/log/oracle
date +" %T %a %D : Finished." >> /var/log/oracle
echo "-------------------------------------------------" >> /var/log/oracle
;;
'stop')
echo "Stoping Oracle Database"
su - oracle -c "$ORACLE_HOME/bin/emctl stop dbconsole" >> /var/log/oracle
echo "Stoping Oracle EM Control ... "
echo "-------------------------------------------------" >> /var/log/oracle
date +" %T %a %D : Stoping Oracle EM Control as part of system down." >> /var/log/oracle
echo "-------------------------------------------------" >> /var/log/oracle
su - oracle -c "$ORACLE_HOME/bin/dbshut" >> /var/log/oracle
echo "Done."
echo ""
echo "-------------------------------------------------" >> /var/log/oracle
date +" %T %a %D : Finished." >> /var/log/oracle
echo "-------------------------------------------------" >> /var/log/oracle
;;
'restart')
$0 stop
$0 start
;;
*)
echo "Usage: oracle {start|stop|restart}"
exit 1
esac
【本人另一篇linux下oracle 10g安装的文章的一步对于以上启动代码】
免责声明: 本文仅代表作者个人观点,与爱易网无关。其原创性以及文中陈述文字和内容未经本站证实,对本文以及其中全部或者部分内容、文字的真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。