Kludge to keep Database Alive

It’s not so pretty and Oracle has the Oracle Restart services for that. But to a temporary and quick need, this script solve the problem:

if ps -fu oracle | grep -v grep | grep ora_smon_orcl >/dev/null
then
echo "orcl instance is up and running"
else
echo "orcl instance is down"
sqlplus /nolog > /dev/null 2>&1 <<EOF
conn / as sysdba
startup
exit
EOF
fi

Matheus.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.