Wednesday, 5 April 2017

RAC/HAS checking

################################
#
# Check for RAC or HAS env - run as root user
#
#
################################


for z in SED
do
GH=`cat /etc/oratab | grep "^+" | cut -f2 -d":"`
export GRID_HOME=${GH}
export PATH=${GRID_HOME}/bin:${PATH}
echo -e "\nChecking type of installation:"
A=`ps -ef | grep -i "orarootagent" | grep -v "grep" | awk '{print $1}' | uniq`
if [ -z ${A} ]
then
  echo -e "\nThis is NOT a RAC host:"
  crsctl check has
else
  CLUN=`cemutlo -n | tr [:lower:] [:upper:]`
  echo -e "\nThis is a RAC host for cluster: ${CLUN}"
  crsctl check crs
  echo "Hostnames:"
  olsnodes

  MMH=`crsctl status resource ora.mgmtdb | grep STATE | awk '{print $NF}'`
  echo -e "Management database host: ${MMH}"
fi
echo -e "\n"
done

No comments:

Post a Comment