Link to home
Start Free TrialLog in
Avatar of orcun_turkec
orcun_turkecFlag for Türkiye

asked on

Windows batch script to check if an oracle database and listener is up

Hi experts,
I' m using windows 2008 server, I need  two DOS batch scripts  to check if an oracle database and listener  is up  and  to send an  e-mail alert which includes computer name, date/time and a message that DB  or Listener is down.  
SOLUTION
Avatar of Bigboj
Bigboj
Flag of Hungary image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of slightwv (䄆 Netminder)
slightwv (䄆 Netminder)

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of orcun_turkec

ASKER

How can this be applied to a batch script   Slightwv ?

As Bigboj said, I wrote a batch script  as shown below ;

@echo off
qprocess oracle.exe
if not  ERRORLEVEL 0 goto :oracle_down
:oracle_down
set MESS=%COMPUTERNAME% oracle.exe not  running
goto mail
:mail
echo %MESS%


How can the sqlplus command ( sqlplus sys/xxxx as sysdba )  can be applied to this script?
And what are other tools or scripts except Blat application for sending mail ?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you