#! /bin/bash
#
sid=$1
#echo ${sid}
# JTK 10/5/2015 - Tweaking for PHNXPD
sid1=${1}1
sid2=${1}2
export RPTDATE=`date '+%m%d'`
export SCRPTDIR=/home/oracle/bin
export RPTDIR=/var/log/oracle
export OUTFILE=$RPTDIR/gather_stat_$sid.lst
export ORACLE_SID=${sid}
# JTK 10/5/2015 - Tweaking for PHNXPD
# Script not setting Oracle Home
export ORACLE_HOME=`/usr/local/bin/dbhome $ORACLE_SID`
export ORACLE_SID=${sid}1
#export ORACLE_SID=${sid}
export PATH=$ORACLE_HOME/bin:/bin:/usr/local/bin:${PATH}
export tmsfile=/var/log/oracle/gather_stat_$sid.time


echo $ORACLE_SID
echo $ORACLE_HOME
echo -n "begin gather statistics : " >> $tmsfile
date >> $tmsfile

# run space report
# JTK 10/5/2015 - Tweaking for PHNXPD
#sqlplus '/as sysdba' @$SCRPTDIR/gather_vmspd_stat.sql $OUTFILE
sqlplus '/as sysdba' @$SCRPTDIR/gather_phnxpd_stat.sql $OUTFILE


echo -n "end  gather statistics : " >> $tmsfile
date >> $tmsfile

exit
