Tell Me When The DB Is Back

database 2
Creative Commons License photo credit: Tim Morgan
Today at work the development DB went down.
My days of fixing databases are long gone, but the guys that are are not so good at letting everyone know that the database is back up.
I created this windows batch script to let me know.

@echo off
if “%1%” == “” goto Error
echo TNS Pinging %1
goto step2
sleep 60
tnsping %1 > c:\temp\tnsping.txt
if errorlevel 1 goto step1
echo %1 is back up !
goto exit
echo You must supply a parameter of TNSName

Leave a Reply