obiee.sh

#!/bin/sh

#Initialization

#get the action/parameter
command=$1

bin_ps=/bin/ps
bin_awk=/usr/bin/awk
bin_grep=/usr/bin/grep

#validate that the action to execute is either start, stop, forcestop or autorestart
if [ “$command” = “start” -o “$command” = “stop” -o “$command” = “forcestop” -o “$command” = “autorestart” ]; then
#set work directory
OBI_HOME=/opt/OBIEE/OracleBI
export OBI_HOME
else
echo “Invalid parameter…”
echo “Syntax: ”
echo ”         obiee.sh { start | stop | forcestop | autorestart }”
exit 1
fi

if [ “$command” = “start” ]; then

echo “obiee.sh WILL START ALL SERVICES…”
echo “”

#Step 1: execute command on OBI Server
processname=run-sa.sh
echo “Executing: ”
echo ${OBI_HOME}/setup/run-sa.sh $command
${OBI_HOME}/setup/run-sa.sh $command
ec=$?
echo “exit code: ” $ec
echo “…”
echo “…”
if [ “$ec”  != “0” ]; then
echo “An error occurred running run-sa.sh … OBIEE.sh is aborting…”
exit 1
fi

#Step 2: execute command on OBI Presentation Services
echo “Executing: ”
echo ${OBI_HOME}/setup/run-saw.sh $command
${OBI_HOME}/setup/run-saw.sh $command
ec=$?
echo “exit code: ” $ec
echo “…”
echo “…”
if [ “$ec”  != “0” ]; then
echo “An error occurred running run-saw.sh … OBIEE.sh is aborting…”
exit 1
fi

#Step 3: execute command on OBI Scheduler
echo “Executing: ”
echo ${OBI_HOME}/setup/run-sch.sh $command
${OBI_HOME}/setup/run-sch.sh $command
ec=$?
echo “exit code: ” $ec
echo “…”
echo “…”
if [ “$ec”  != “0” ]; then
echo “An error occurred running run-sch.sh … OBIEE.sh is aborting…”
exit 1
fi

#Step 4: execute command on OBI Cluster Controller
echo “Executing: ”
echo ${OBI_HOME}/setup/run-ccs.sh $command
${OBI_HOME}/setup/run-ccs.sh $command
ec=$?
echo “exit code: ” $ec
if [ “$ec”  != “0” ]; then
echo “An error occurred running run-ccs.sh … OBIEE.sh is aborting…”
exit 1
fi

elif [ “$command” = “stop” -o “$command” = “forcestop” ]; then

echo “obiee.sh WILL SHUTDOWN ALL SERVICES…”
echo “”

#Step 4: execute command on OBI Cluster Controller
echo “Executing: ”
echo ${OBI_HOME}/setup/run-ccs.sh $command
${OBI_HOME}/setup/run-ccs.sh $command
ec=$?
echo “exit code: ” $ec
echo “…”
echo “…”
if [ “$ec”  != “0” ]; then
echo “An error occurred running run-ccs.sh … OBIEE.sh is aborting…”
exit 1
fi

#Step 3: execute command on OBI Scheduler
echo “Executing: ”
echo ${OBI_HOME}/setup/run-sch.sh $command
${OBI_HOME}/setup/run-sch.sh $command
ec=$?
echo “exit code: ” $ec
echo “…”
echo “…”
if [ “$ec”  != “0” ]; then
echo “An error occurred running run-sch.sh … OBIEE.sh is aborting…”
exit 1
fi

#Step 2: execute command on OBI Presentation Services
echo “Executing: ”
echo ${OBI_HOME}/setup/run-saw.sh $command
${OBI_HOME}/setup/run-saw.sh $command
ec=$?
echo “exit code: ” $ec
echo “…”
echo “…”
if [ “$ec”  != “0” ]; then
echo “An error occurred running run-saw.sh … OBIEE.sh is aborting…”
exit 1
fi

#Step 1: execute command on OBI Server
echo “Executing: ”
echo ${OBI_HOME}/setup/run-sa.sh $command
${OBI_HOME}/setup/run-sa.sh $command
ec=$?
echo “exit code: ” $ec
if [ “$ec”  != “0” ]; then
echo “An error occurred running run-sa.sh … OBIEE.sh is aborting…”
exit 1
fi

fi

exit 0

Advertisements

One response to “obiee.sh

  1. Pingback: So I installed OBIEE, now what? « PeopleSoft HCM & EPM Warehouse

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s