#!/bin/ksh
# Check passed parameters
if [ $# -ne 2 ]
then
echo "Please provide parameters"
echo "Parameter 1 - Domain"
echo "Parameter 2 - start or stop"
exit
fi
export ENVID=$1
export ACTION=$2
export WL_HOME=/spl/middleware10.3.3/wlserver_10.3
export BEADIR=/spl/middleware10.3.5
export BEA_HOME=/spl/middleware10.3.5
export HIBERNATE_JAR_DIR=/opt/hibernate3.3.2
export HIBERNATE_JAR_PATH=/opt/hibernate3.3.2
export JAVA_HOME=/usr/java6
#export DOMAIN=$ENVID"_"domain
export DOMAIN=$ENVID
export FMW_HOME=/spl/$ENVID
###################################################
#/spl/bibase/user_projects/domains/bibase_domain/servers/AdminServer/security/boot.properties#
#/spl/bibase/user_projects/domains/bibase_domain/servers/bi_server1/security/boot.properties#
###################################################
if [ $ACTION = "start" ]
then
#####################################################
#Setting the environment #
#####################################################
. $FMW_HOME/user_projects/domains/$DOMAIN/bin/setOBIDomainEnv.sh
. $FMW_HOME/user_projects/domains/$DOMAIN/bin/setDomainEnv.sh
#####################################################
# startup the WLS #
#####################################################
echo "startup the WLS..."
# export WLS_REDIRECT_LOG=/home/cissys/wls_$ENVID.log
export WLS_REDIRECT_LOG=/spl/logs/wls_$ENVID.log
mv $WLS_REDIRECT_LOG $WLS_REDIRECT_LOG"_"`date +"%Y-%m-%d-%H:%M:%S"`
touch $WLS_REDIRECT_LOG
. $FMW_HOME/user_projects/domains/$DOMAIN/bin/startWebLogic.sh &
while [ `grep -c "RUNNING mode" $WLS_REDIRECT_LOG` -ne 1 ]
do
echo "Waiting for Weblogic starting...wait for 30 seconds"
sleep 30
done
#####################################################
#startup node manager #
#####################################################
echo
echo
echo "please run the following command in another session..."
echo
echo
echo "$FMW_HOME/wlserver_10.3/server/bin/startNodeManager.sh &"
echo
echo "Waiting 30 seconds"
sleep 30
# echo "startup node manager..."
# . $FMW_HOME/wlserver_10.3/server/bin/startNodeManager.sh &
echo
echo
echo "checking nodemanager log before continuing BI startup"
echo
while [ `tail -1 /spl/$ENVID/wlserver_10.3/common/nodemanager/nodemanager.log|grep -c "Secure socket listener started on port"` -ne 1 ]
do
echo "Waiting for Node Manager starting....30 seconds..."
sleep 30
done
#####################################################
#startup Managed Server #
#####################################################
echo "pausing for 60 seconds..."
sleep 60
echo "startup Managed Server..."
# export WLS_REDIRECT_LOG=/home/cissys/wls_managerdserver_$ENVID.log
export WLS_REDIRECT_LOG=/spl/logs/wls_managedserver_$ENVID.log
mv $WLS_REDIRECT_LOG $WLS_REDIRECT_LOG"_"`date +"%Y-%m-%d-%H:%M:%S"`
touch $WLS_REDIRECT_LOG
. $FMW_HOME/user_projects/domains/$DOMAIN/bin/startManagedWebLogic.sh bi_server1 &
while [ `grep -c "RUNNING mode" $WLS_REDIRECT_LOG` -ne 1 ]
do
echo "Waiting for Managed Server starting...wait for 30 seconds"
sleep 30
done
#####################################################
#startup opmn #
#####################################################
echo "pausing for 60 seconds..."
sleep 60
echo "startup opmn..."
# $FMW_HOME/instances/$ENVID/bin/opmnctl startall &
$FMW_HOME/instances/instance1/bin/opmnctl startall &
echo
echo
echo "pausing for 30 seconds..."
sleep 30
echo
echo "Oracle BI 11g / OBUI V2.4 is now running..."
fi
if [ $ACTION = "stop" ]
then
$FMW_HOME/instances/$1/bin/opmnctl stopall
. $FMW_HOME/wlserver_10.3/server/bin/setWLSEnv.sh
$FMW_HOME/user_projects/domains/$DOMAIN/bin/stopManagedWebLogic.sh bi_server1
ps -ef |grep Node|grep nodemanager | grep -v grep|awk '{print $2}' | xargs kill -9
ps -ef |grep nqsserver | grep -v grep|awk '{print $2}' | xargs kill -9
ps -ef |grep nqscheduler | grep -v grep|awk '{print $2}' | xargs kill -9
#####################################################
#Setting the environment #
#####################################################
. $FMW_HOME/user_projects/domains/$DOMAIN/bin/setOBIDomainEnv.sh
. $FMW_HOME/user_projects/domains/$DOMAIN/bin/setDomainEnv.sh
$FMW_HOME/user_projects/domains/$DOMAIN/bin/stopWebLogic.sh
ps -ef | grep -w $ENVID | grep -v grep | awk '{print $2}' | xargs kill -9
fi
exit
No comments:
Post a Comment