Hi ,
I want to write a batch script which will check the Databse status and then proceed for the further task, I allready have done same task in Shell script but not able to make it in DOS (Windows XP) , IF anybody can suggest how to achive the dask will be very useful. any other code (like VBScript- which can be run from dos prompt) will also do
I am using tnsping to chek the database ststus if it returns OK then database is up, so in Unix I am using following code
tnsping $ORACLE_SID > tnschk.lst
WC=`grep -i 'OK' tnschk.lst | wc -l`
export WC
echo $WC
if [ "$WC" -lt "1" ]; then
echo Database is not running |mailx -s "Database not running" gp815@cummins.com
rm $CTRL_DIR/3plshell.lock
err=$?
if test $err -ne 0
then
echo "Error occurred while attempting to send an email. Exiting..."
rm $CTRL_DIR/3plshell.lock
exit 1
fi
rm $CTRL_DIR/3plshell.lock
exit 1
fi
Same task I want achive in WIndows
Please help
Start Free Trial