datbase server check and space check using windows batch file
Hi All,
I want to create a windows batch file to check whether given two servers are up or not.
If up, I need to connect to the database of those servers and send an email only if
--the space used in the database is more than 70% of available total datbase space
--the password is about to expire in 15 days
Environment : Oracle 11gR2, Windows 7
To do this I can create .sql file and .bat file.
I tried using :
@echo off
ping <server IP>
IF ERRORLEVEL 0 echo "UP" ELSE echo "down" --i found it somewhere on the net and tried
even,when i gave an IP to which i'm not able to connect, i always see "UP".
--> How can i make sure whether the server is up or down and send mail accordingly?
--> When I write a select stmt, how do i store the o/p data in the variables in batch file ?
--> Also, sending email using windows batch file ?
I have never created a batch script before, so I need your help/guidance on this.
Thanks.