Techno

things which came out my laptop

Script to Start Oracle if It Is Not Running

As part of my current job, I am working as “part time” oracle dba. Due to some known issues in oracle, our oracle server goes down. Till we upgrade to Fixed version, I had to restart oracle manually. To overcome that I wrote script will be run as cron job,

Script:

#!/bin/bash
#
#
# Run-level Startup script for Instance
# It relies on the information on pmon
check_stat=`ps -aef |grep pmon | grep -v grep | wc -l`;
oracle_num=`expr $check_stat`
if [ $oracle_num -ne 0 ]
then
oracle start
exit 16
fi


added this script as part of linux “cron” jobs.

Enjoy!!!