#!/bin/sh # # dbora This scripts starts and shuts down the oracle databas # # chkconfig: 345 99 10 # description: This script calls the dbstart script to start Oracle # and dbshut to stop it # processname: oracle* # config: /etc/oratab # # Source function library. . /etc/rc.d/init.d/functions ORA_HOME=/u01/app/oracle/product/8.1.7.0.1 ORA_OWNER=oracle if [ ! -f $ORA_HOME/bin/dbstart ]; then echo Sorry... the $ORA_HOME/bin/dbstart script is missing echo Cannot start Oracle exit fi case "$1" in 'start') su - $ORA_OWNER -c "lsnrctl start" & sleep 2 su - $ORA_OWNER -c $ORA_HOME/bin/dbstart & ;; 'stop') su - $ORA_OWNER -c "lsnrctl stop" & sleep 2 su - $ORA_OWNER -c $ORA_HOME/bin/dbshut & ;; esac