#!/bin/sh
#modify for your environment
. /etc/rc.status
export ORACLE_BASE=/opt/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2/db_1
export PATH=$ORACLE_HOME/bin:$PATH
export ORACLE_SID=orcl
export ORACLE_USER=oracle
scriptname='basename $0'
case $1 in
start)
$ORACLE_HOME/bin/localconfig reset
su - "$ORACLE_USER"<<EOO
$ORACLE_HOME/bin/lsnrctl start
$ORACLE_HOME/bin/isqlplusctl start
$ORACLE_HOME/bin/emctl start dbconsole
sqlplus /nolog
connect / as sysdba
startup
EOO
touch /var/lock/subsys/$scriptname
;;
stop)
/etc/init.d/init.cssd stop
su - "$ORACLE_USER"<<EOO
$ORACLE_HOME/bin/lsnrctl stop
$ORACLE_HOME/bin/isqlplusctl stop
$ORACLE_HOME/bin/emctl stop dbconsole
sqlplus /nolog
connect / as sysdba
shutdown immediate
EOO
rm -f /var/lock/subsys/$scriptname
;;
*)
echo "Usage: $0 {start|stop}"
;;
esac
No comments:
Post a Comment