Hi Jose,

Many many thanks to you. This is great.

Joan



Jose Luis Delgado wrote:
> 
> Hi!!
> 
> 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>
> 
> Hope this helps!
> JL
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Tax Center - forms, calculators, tips, more
> http://taxes.yahoo.com/
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Jose Luis Delgado
>   INET: [EMAIL PROTECTED]
> 
> Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
> San Diego, California        -- Mailing list and web hosting services
> ---------------------------------------------------------------------
> To REMOVE yourself from this mailing list, send an E-Mail message
> to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
> the message BODY, include a line containing: UNSUB ORACLE-L
> (or the name of mailing list you want to be removed from).  You may
> also send the HELP command for other information (like subscribing).
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Joan Hsieh
  INET: [EMAIL PROTECTED]

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: [EMAIL PROTECTED] (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).

Reply via email to