Advertisement

01.15.2008 at 01:36AM PST, ID: 23083328
[x]
Attachment Details

Check Oracle Database Status from DOS COmmand Prompt/Batch File

Asked by sachinrp in Windows Batch Scripting

Tags: Mi, Dos (Batch Script), Windows XP

Hi ,
I want to write a batch script which will check the Databse status and then proceed for the further task, I allready have done same task in Shell script but not able to make it in DOS (Windows XP) , IF anybody can suggest how to achive the dask will be very useful. any other code (like VBScript- which can be run from dos prompt) will also do

I am using tnsping to chek the database ststus if it returns OK then database is up, so in Unix I am using following code

tnsping $ORACLE_SID > tnschk.lst
WC=`grep -i 'OK' tnschk.lst | wc -l`
export WC
echo $WC
if [ "$WC" -lt "1" ]; then
        echo Database is not running |mailx -s "Database not running" gp815@cummins.com
      rm $CTRL_DIR/3plshell.lock
        err=$?
      if test $err -ne 0
      then
            echo "Error occurred while attempting to send an email. Exiting..."
            rm $CTRL_DIR/3plshell.lock
            exit 1
        fi
        rm $CTRL_DIR/3plshell.lock
        exit 1
fi
Same task I want achive in WIndows

Please helpStart Free Trial
[+][-]01.19.2008 at 08:24AM PST, ID: 20697856

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]01.27.2008 at 11:11PM PST, ID: 20757302

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: Windows Batch Scripting
Tags: Mi, Dos (Batch Script), Windows XP
Sign Up Now!
Solution Provided By: sachinrp
Participating Experts: 2
Solution Grade: B
 
 
[+][-]02.29.2008 at 06:46AM PST, ID: 21013617

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]02.29.2008 at 08:03PM PST, ID: 21019840

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628