Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

datbase server check and space check using windows batch file

user3006396Mar 21 2012 — edited Mar 22 2012
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.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 19 2012
Added on Mar 21 2012
3 comments
309 views