Description :

This script is used to find total number of database startup in the year or month. You can schedule the script in crontab for every month.

Script :

#!/bin/sh
date
location=`find / -name alert_$ORACLE_SID.log 2>/dev/null`
read -p “Please enter which year you want ( Please Provide year in sysdate format ( ie : 2018 or 18)) : ” year
read -p “Select any Month ( Please Provide month in sysdate format ( ie : Jul or 07)) : ” month
read -p “If you need DB Startup status in detail ? (y/n):” a
if test “$a” = “y”
then
cat $location | grep -B2 “Starting ORACLE instance” | grep -i $year | grep -i $month
else
cat $location | grep -B2 “Starting ORACLE instance” | grep -i $year | grep -i $month | wc -l
f
fi

 

Note : This script is successfully run in Linux environment.

Recent Posts

Start typing and press Enter to search