[root@HS21_Blade01 ~]# more /etc/init.d/dbora
#!/bin/bash
######################################################################
# Description: Script to output Oracle related processes #
# File: /etc/rc.d/init.d/dbora #
######################################################################
# Setup environment for script execution
# chkconfig: 2345 98 89
# description: oracle10g start/stop script.
. /etc/profile
# Determine and execute action based on command line parameter
case "$1" in
start)
echo "Starting Oracle database(s) listed in /etc/oratab ..."
sleep 2
su - oracle -c "$ORACLE_HOME/bin/dbstart"
echo "Starting TNS listener ..."
sleep 2
su - oracle -c "$ORACLE_HOME/bin/lsnrctl start"
touch /var/lock/subsys/dbora
;;
stop)
echo "Shutting down TNS listener ..."
sleep 2
su - oracle -c "$ORACLE_HOME/bin/lsnrctl stop"
echo "Shutting down Oracle database(s) listed in /etc/oratab ..."
sleep 2
su - oracle -c "$ORACLE_HOME/bin/dbshut"
rm -f /var/lock/subsys/dbora
;;
status)
ps -ax | grep -e ora_ -e tnslsnr
;;
*)
echo "Usage: dbora {start|stop|status}"
exit 1
esac
exit 0
阅读(1393) | 评论(0) | 转发(0) |