Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: nt script

Re: nt script

From: Jay <fish_dba_at_hotmail.com>
Date: Sat, 08 Mar 2003 06:08:36 -0800
Message-ID: <F001.00563F87.20030308060836@fatcity.com>


You might want to look at VBScript, it is easy to learn and can be executed on any Win platform.

> One bump you might encounter is some of the more useful NT shell commands
are only available from the NT resource kit.
>
>
>
> >>> jherrick_at_igs.net 03/07/03 01:09PM >>>
>
> C:\> HELP
>
> and
>
> C:\> HELP FOR
>
> In there you'll find a note that the context variable should have
> '%%' instead of '%' in front of it when running in a bat file.
>
> You were using the bat file syntax from a command line....won't
> work. The opposite is also true...ask me how I know =8-)
>
> Jeff Herrick
>
> On Fri, 7 Mar 2003, Jacques Kilchoer wrote:
>
> > 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:joseluis_delgado_at_yahoo.com]
> > >
> > > 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/password_at_instance < 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>
> >
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.net
> --
> Author: Jeff Herrick
> INET: jherrick_at_igs.net
>
> 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: ListGuru_at_fatcity.com (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: Darrell Landrum
> INET: dlandrum_at_zalecorp.com
>
> 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: ListGuru_at_fatcity.com (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: Jay
  INET: fish_dba_at_hotmail.com

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: ListGuru_at_fatcity.com (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).
Received on Sat Mar 08 2003 - 08:08:36 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US