LJ Archive

Listing 4. dbora Script

!/bin/sh
. /etc/rc.d/init.d/functions
ORA_HOME=/u01/app/oracle/product/8.1.5
ORA_OWNER=oracle
case "$1" in
   'start')
      echo "Starting Oracle instances"
      su - $ORA_OWNER -c $ORA_HOME/bin/dbstart > /var/log/dbstart.log 2>&1 &
      echo ""
      echo -n "Starting the listener"
      su - $ORA_OWNER -c $ORA_HOME/bin/lsnrstart >> /var/log/dbstart.log 2>&1 &
      touch /var/lock/subsys/dbora
      ;;
   'stop')
      echo "Stopping the listener"
      su - $ORA_OWNER -c $ORA_HOME/bin/lsnrstop > /var/log/dbshut.log 2>&1
      echo ""
      echo -n "Stopping Oracle instances"
      su - $ORA_OWNER -c $ORA_HOME/bin/dbshut >> /var/log/dbshut.log 2>&1
      rm -f /var/lock/subsys/dbora
      ;;
esac
LJ Archive