#!/bin/ksh
####################################################################
# start_sap_ecp
####################################################################
 
#
#1.Show me obvious information in hacmp.out
#

banner "Starting"
banner "SAP EPP"
 
#
#1.Set the oracle and sap owner.
#

ORASID="EPP"
SAPADM="eppadm"
ORAUSR="oraepp"
VIRTUALHOST="epprd"
DEVHOST="epdev"
DAAADM="daaadm"

#
#1.Get the volume groups for this resource group
#

RG=$( /usr/es/sbin/cluster/utilities/cllsgrp | grep -i $ )
VG_LIST=$( /usr/es/sbin/cluster/utilities/cllsres -g $ | \
        grep "VOLUME_GROUP=" | \
        awk -F\" '{ print $2 }' )
 
 
####################################################################
#Start SAP and Oracle
####################################################################

#
#Start listener
#

su - $ORAUSR -c lsnrctl start 
rc=$? 
if [ $? != 0 ] 
  then 
        echo "ERROR: Listener failed to start\n" 
fi 

 
#
#1.Standard sapstart script
#

su - $SAPADM -c startsap epprd
rc=$? 
if [ $? != 0 ] 
  then         
        echo "ERROR: Failed to start SAP\n" 
fi 

#
#2. Start Diagnotics Agent
#

su - $DAAADM -c startsap epprd
rc=$?
if [ $? != 0 ]
  then
    echo "ERROR: Failed to start Diagnotics Agent \n"
fi

#
#3. Start webdispatcher
#

su - $SAPADM -c "nohup /sapmnt/EPP/exe/uc/rs6000_64/sapwebdisp pf=/usr/sap/sapwebdisp/sapwebdisp.pfl &"

exit 0
