- #!/bin/bash
- # chkconfig: 345 99 10
- # description: Startup Script for oracle Databases
- # /etc/rc.d/init.d/dbstart
- export ORACLE_BASE=/u01/app/oracle/
- export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
- export ORACLE_SID=orcl
- export PATH=$PATH:$ORACLE_HOME/bin
- ORA_OWNR="oracle"
- # if the executables do not exist -- display error
- if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
- then
- echo "Oracle startup: cannot start"
- exit 1
- fi
- # depending on parameter -- startup, shutdown, restart
- # of the instance and listener or usage display
- case "$1" in
- start)
- # Oracle listener and instance startup
- echo -n "Starting Oracle: "
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/dbstart"
- touch /var/lock/oracle
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/emctl start dbconsole"
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctrl start"
- echo "OK"
- ;;
- stop)
- # Oracle listener and instance shutdown
- echo -n "Shutdown Oracle: "
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/emctl stop dbconsole"
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/isqlplusctrl stop"
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/dbshut"
- su - $ORA_OWNR -c "$ORACLE_HOME/bin/lsnrctl stop"
- rm -f /var/lock/oracle
- echo "OK"
- ;;
- reload|restart)
- $0 stop
- $0 start
- ;;
- *)
- echo "Usage: `basename $0` start|stop|restart|reload"
- exit 1
- esac
- exit 0
- #!/bin/bash
- # chkconfig: 345 99 10
- # description: Startup Script for oracle Databases
- # /etc/rc.d/init.d/oradbstart
- export ORACLE_BASE=/u01/app/oracle/
- export ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
- export ORACLE_SID=orcl
- export PATH=$PATH:$ORACLE_HOME/bin
- case "$1" in
- start)
- su oracle -c $ORACLE_HOME/bin/dbstart
- touch /var/lock/oracle
- echo "OK"
- ;;
- stop)
- echo -n "Shutdown oracle: "
- su oracle -c $ORACLE_HOME/bin/dbshut
- rm -f /var/lock/oracle
- echo "OK"
- ;;
- *)
- echo "Usage: 'basename $0' start|stop"
- exit 1
- esac
- exit 0