#!/bin/bash # # chkconfig: 35 99 10 # description: Starts and stops Oracle processes # ORA_HOME=/var/opt/oracle/product/10.2.0/db_1 ORA_OWNER=oracle case "$1" in 'start') # Start the TNS Listener su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start" # Start the Oracle databases: su - $ORA_OWNER -c $ORA_HOME/bin/dbstart # Start the Intelligent Agent if [ -f $ORA_HOME/bin/emctl ]; then su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start agent" elif [ -f $ORA_HOME/bin/agentctl ]; then su - $ORA_OWNER -c "$ORA_HOME/bin/agentctl start" else su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl dbsnmp_start" fi # Start Management Server if [ -f $ORA_HOME/bin/emctl ]; then su - $ORA_OWNER -c "$ORA_HOME/bin/emctl start dbconsole" elif [ -f $ORA_HOME/bin/oemctl ]; then su - $ORA_OWNER -c "$ORA_HOME/bin/oemctl start oms" fi # Start HTTP Server if [ -f $ORA_HOME/Apache/Apache/bin/apachectl]; then su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/bin/apachectl start" fi touch /var/lock/subsys/dbora ;; 'stop') # Stop HTTP Server if [ -f $ORA_HOME/Apache/Apache/bin/apachectl ]; then su - $ORA_OWNER -c "$ORA_HOME/Apache/Apache/bin/apachectl stop" fi # Stop the TNS Listener su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop" # Stop the Oracle databases: su - $ORA_OWNER -c $ORA_HOME/bin/dbshut rm -f /var/lock/subsys/dbora ;; esac # End of script dbora