Title: RE: nt script
I have found http://www.calweb.com/~webspace/batch/index.htm to be useful.
 
Raj
-------------------------------------------------------------
Rajendra dot Jamadagni at espn dot com
Any views expressed here are strictly personal.
QOTD: Any clod can have facts, having an opinion is an art !!
-----Original Message-----
From: Jacques Kilchoer [mailto:[EMAIL PROTECTED]
Sent: Friday, March 07, 2003 1:34 PM
To: Multiple recipients of list ORACLE-L
Subject: RE: nt script

Can anyone recommend a book / website on the DOS batch file language? I usually try to install cygwin and write shell scripts but some of our database servers don't have cygwin.

For example, I have no idea what this statement does:
FOR /F "TOKENS=1,2*" %%A IN ('DATE/T') DO SET DATE=%%B
and when I tried it I received an error
H:\>FOR /F "TOKENS=1,2*" %%A IN ('DATE/T') DO SET DATE=%%B
%%A was unexpected at this time.

> -----Original Message-----
> From: Jose Luis Delgado [mailto:[EMAIL PROTECTED]]
>
> I'll try to help you between lines...
>
> i.e. I'll write the corresponding CMD line for your
> script.
>
> Regards!
> JL
>
> in a .CMD file:
>
> > echo Sending mail!!!
> echo Sending mail!!!
>
> > dt=$(date '+%H%M_%m%d%y')
> FOR /F "TOKENS=1,2*" %%A IN ('DATE/T') DO SET DATE=%%B
>
> > export ORACLE_SID=FMRPT
> SET ORACLE_SID=FMRPT
>
> >     sqlplus / <<EOF! > sqllog
>
> in a file: say a.sql put the code of your query and
> type:
>
> sqlplus user/[EMAIL PROTECTED] < a.sql > sqllog.log
>
> >    set heading off
> >     SELECT 'FMRPT PSNTRP02 SCHEDULER DOWN' FROM DUAL
> >   WHERE EXISTS (SELECT 'X' FROM PSSERVERSTAT
> >  ...
> >  ...
>
> > cat sqllog |egrep 'DOWN' > errfilelog
>
> type sqllog.log | findstr 'DOWN' > errfilelog.log
>
> > cat sqllog | egrep -q 'DOWN'
>
> I apologize for the previous line, I could not find a
> -q parameter of the egrep command, in my OS.
> anyway... 'guessing'
>
> type sqllog | findstr -<look the apropiate cmd> 'DOWN'
>
> >         if [ $? -eq 0 ]         # found at least one
>
> if errorlevel 1 <your_mail_program_here>

********************************************************************This e-mail 
message is confidential, intended only for the named recipient(s) above and may 
contain information that is privileged, attorney work product or exempt from 
disclosure under applicable law. If you have received this message in error, or are 
not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 
and delete this e-mail message from your computer, Thank 
you.*********************************************************************2

Reply via email to