for z in BIGLEY BIGLEYDR
do
FIL=OracleFlag_${z}
if [ -f ${FIL} ]
then
#echo "Flag set"
TS=`ls -altr ${FIL} | awk '{print $6, $7, $8}'`
echo -e "\n\nFlag set for: "${z}" on ${TS} \n\t\tso this database will not be started\n\n"
else
echo -e "\n\n--> Flag NOT set for ${z} <-- "
echo -e "\nWill start database ${z}\n\n"
STA=`ps -ef | grep smon | grep -Ev "grep|ASM|agent|bin" | awk '{print $NF}' | cut -f3 -d"_"`
# echo $STA
if [ ${STA} = ${z} ]
then
echo -e "\nDatabase ${STA} is already running!!\n"
else
echo -e "Starting database ${STA}"
fi
fi
done
No comments:
Post a Comment