Monitorar Status Oracle Database

#!/bin/bash
# Pré Requisito que os bancos estejam no /etc/oratab
 
ORATAB=/etc/oratab
echo "`date`   "
echo  "Oracle Database(s) Status `hostname` :\n"
 
db=`egrep -i ":Y|:N" $ORATAB | cut -d":" -f1 | grep -v "\#" | grep -v "\*"`
pslist="`ps -ef | grep pmon`"
for i in $db ; do
  echo  "$pslist" | grep  "ora_pmon_$i"  > /dev/null 
  if (( $? )); then
        echo "Oracle Instance - $i:       Down"
  else
      echo "Oracle Instance - $i:       Up"
  fi
done
ShellScript

Leave a Reply

Your email address will not be published. Required fields are marked *

search previous next tag category expand menu location phone mail time cart zoom edit close