Tuesday, July 04, 2006
Oracle Collaboration Suite 10g Start/Stop Scripts
Here are two scripts that can be used for starting and stopping Oracle Collaboration Suite 10g Infrastructure and Applications.
Script ocsi starts/stops infrastructure, while ocsa starts/stops applications tier. Those scripts can be installed as RedHat services for automatic starting and stopping of OCS.
You need to set ORACLE_BASE and ORACLE_HOME variables to values required by your server.
ocsi
-------------------------------------------------------------------
#!/bin/bash
#
# chkconfig: 35 94 1
# description: init script to start/stop OCS 10g Infrastructure
#
#
# match these values to your environment:
export ORACLE_BASE=/u01/app
export ORACLE_HOME=$ORACLE_BASE/product/10.1.2/infra
export ORACLE_TERM=xterm
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$PATH
export ORACLE_SID=infra
export ORACLE_USER=oracle
# see how we are called:
case $1 in
start)
su - "$ORACLE_USER"<<EOO
lsnrctl start
sqlplus /nolog<<EOS
connect / as sysdba
startup
EOS
# emctl start dbconsole
opmnctl startall
sleep 20
EOO
;;
stop)
su - "$ORACLE_USER"<<EOO
lsnrctl stop
sqlplus /nolog<<EOS
connect / as sysdba
shutdown immediate
EOS
emctl stop dbconsole
opmnctl stopall
sleep 20
EOO
;;
*)
echo "Usage: $0 {start|stop}"
;;
esac
-------------------------------------------------------------------
ocsa
-------------------------------------------------------------------
#!/bin/bash
#
# chkconfig: 35 95 1
# description: init script to start/stop OCS 10g Applications
#
#
# match these values to your environment:
export ORACLE_BASE=/u01/app
export ORACLE_HOME=$ORACLE_BASE/product/10.1.2/apps
export ORACLE_TERM=xterm
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/ocas/bin:$PATH
export ORACLE_SID=infra
export ORACLE_USER=oracle
# see how we are called:
case $1 in
start)
tnslsnr listener_es -user 502 -group 500 &
su - "$ORACLE_USER"<<EOO
opmnctl startall
sleep 20
ocasctl -startall
sleep 20
EOO
;;
stop)
su - "$ORACLE_USER"<<EOO
lsnrctl stop listener_es
emctl stop dbconsole
sleep 20
opmnctl stopall
sleep 20
ocasctl -stopall
sleep 20
EOO
;;
*)
echo "Usage: $0 {start|stop}"
;;
esac
-------------------------------------------------------------------
Script ocsi starts/stops infrastructure, while ocsa starts/stops applications tier. Those scripts can be installed as RedHat services for automatic starting and stopping of OCS.
You need to set ORACLE_BASE and ORACLE_HOME variables to values required by your server.
ocsi
-------------------------------------------------------------------
#!/bin/bash
#
# chkconfig: 35 94 1
# description: init script to start/stop OCS 10g Infrastructure
#
#
# match these values to your environment:
export ORACLE_BASE=/u01/app
export ORACLE_HOME=$ORACLE_BASE/product/10.1.2/infra
export ORACLE_TERM=xterm
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$PATH
export ORACLE_SID=infra
export ORACLE_USER=oracle
# see how we are called:
case $1 in
start)
su - "$ORACLE_USER"<<EOO
lsnrctl start
sqlplus /nolog<<EOS
connect / as sysdba
startup
EOS
# emctl start dbconsole
opmnctl startall
sleep 20
EOO
;;
stop)
su - "$ORACLE_USER"<<EOO
lsnrctl stop
sqlplus /nolog<<EOS
connect / as sysdba
shutdown immediate
EOS
emctl stop dbconsole
opmnctl stopall
sleep 20
EOO
;;
*)
echo "Usage: $0 {start|stop}"
;;
esac
-------------------------------------------------------------------
ocsa
-------------------------------------------------------------------
#!/bin/bash
#
# chkconfig: 35 95 1
# description: init script to start/stop OCS 10g Applications
#
#
# match these values to your environment:
export ORACLE_BASE=/u01/app
export ORACLE_HOME=$ORACLE_BASE/product/10.1.2/apps
export ORACLE_TERM=xterm
export PATH=$ORACLE_HOME/bin:$ORACLE_HOME/opmn/bin:$ORACLE_HOME/ocas/bin:$PATH
export ORACLE_SID=infra
export ORACLE_USER=oracle
# see how we are called:
case $1 in
start)
tnslsnr listener_es -user 502 -group 500 &
su - "$ORACLE_USER"<<EOO
opmnctl startall
sleep 20
ocasctl -startall
sleep 20
EOO
;;
stop)
su - "$ORACLE_USER"<<EOO
lsnrctl stop listener_es
emctl stop dbconsole
sleep 20
opmnctl stopall
sleep 20
ocasctl -stopall
sleep 20
EOO
;;
*)
echo "Usage: $0 {start|stop}"
;;
esac
-------------------------------------------------------------------
