Script: start/stop stellent UCM server

Note: If you don't setup the sudo bypass the password, it will not work well. please see my pre-doc to setup the sudo.
Start UCM server:
#!/bin/sh

export ORACLE_HOME=/opt/l360/ucm/product/10132
export ORACLE_SID=orcl
export UCM_HOME=/opt/l360/ucm/product/ucm/server
export APACHE_HOME=/opt/l360/ucm/product/apache2

export PATH=$ORACLE_HOME/bin:$UCM_HOME/etc:$APACHE_HOME/bin:$PATH

LOG_FILE=start.log

echo "starting ucm database..."
lsnrctl start
sqlplus sys/oracle as sysdba <<endOFsqlplus > $LOG_FILE
startup
exit
endOFsqlplus

echo "starting ucm server..."
idcserver_start > $LOG_FILE

echo "starting apache server..."
sudo $APACHE_HOME/bin/httpd -d $APACHE_HOME -k start > $LOG_FILE

echo "UCM service started!"

Stop UCM server:

#!/bin/sh

export ORACLE_HOME=/opt/l360/ucm/product/10132
export ORACLE_SID=orcl
export UCM_HOME=/opt/l360/ucm/product/ucm/server
export APACHE_HOME=/opt/l360/ucm/product/apache2

export PATH=$ORACLE_HOME/bin:$UCM_HOME/etc:$APACHE_HOME/bin:$PATH

LOG=stop.log

echo "stop apache server..."
sudo $APACHE_HOME/bin/httpd -d $APACHE_HOME -k stop > $LOG

echo "stop ucm server..."
idcserver_stop > $LOG

echo "stop ucm database..."
sqlplus sys/oracle as sysdba <<endOFsqlplus > $LOG
shutdown immediate
exit
endOFsqlplus

lsnrctl stop

echo "UCM service stopped!"

猜你喜欢

转载自fengyonghui.iteye.com/blog/570355
UCM