Categories
Oracle Windows Work

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

Your email address will not be published. Required fields are marked *