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
cls
if “%1%” == “” goto Error
echo TNS Pinging %1
goto step2
:step1
sleep 60
:step2
tnsping %1 > c:\temp\tnsping.txt
if errorlevel 1 goto step1
echo %1 is back up !
goto exit
:error
echo You must supply a parameter of TNSName
:exit

Leave a Reply

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)