Re: nt script

2003-07-02 Thread Joan Hsieh
Thanks to all who replied. Especialy thanks to Seefelt. This solution works. except errorlevel 1 is not a match. Thanks again!!! Joan "Seefelt, Beth" wrote: > > That actually makes it alot easier > > FOR /F "tokens=1-5 delims=/, " %%i in ('date/t') DO SET MMDD=%%j%%k > if NOT EXIST psprcsrv_p

Re: nt script

2003-07-02 Thread Joan Hsieh
1/2003 02:49 PM > Please respond to ORACLE-L > > > To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> > cc: > Subject:RE: nt script > > FIND or FINDSTR should work equally well, I think. Maybe it depends on > your exact platfor

RE: nt script

2003-07-01 Thread Jared . Still
cc: Subject:RE: nt script FIND or FINDSTR should work equally well, I think. Maybe it depends on your exact platform. -Original Message- Sent: Tuesday, July 01, 2003 5:07 PM To: Multiple recipients of list ORACLE-L Hi... I could not follow this thread, so, I do

RE: nt script

2003-07-01 Thread Seefelt, Beth
FIND or FINDSTR should work equally well, I think. Maybe it depends on your exact platform. -Original Message- Sent: Tuesday, July 01, 2003 5:07 PM To: Multiple recipients of list ORACLE-L Hi... I could not follow this thread, so, I do not know the current status... anyway... I teste

Re: nt script

2003-07-01 Thread Joan Hsieh
Seefelt, It picked up the right log. however, it ended up run errorleverl 1 in any condition (with or without a match). Isn't that interesting? Joan "Seefelt, Beth" wrote: > > That actually makes it alot easier > > FOR /F "tokens=1-5 delims=/, " %%i in ('date/t') DO SET MMDD=%%j%%k > if NOT EX

RE: nt script

2003-07-01 Thread Jose Luis Delgado
Hi... I could not follow this thread, so, I do not know the current status... anyway... I tested this and it works... 1.- First, I saw that you asked for: string called ORA and your errorlevel statement failed. 2.- Second, the script sent by: Seefelt, Beth looks like it works (I did not test it

RE: nt script

2003-07-01 Thread Seefelt, Beth
That actually makes it alot easier FOR /F "tokens=1-5 delims=/, " %%i in ('date/t') DO SET MMDD=%%j%%k if NOT EXIST psprcsrv_psnt_%MMDD%.log goto no_file FIND "ORA-03313" psprcsrv_psnt_%MMDD%.log if errorlevel 1 ( echo 'there is a match' d:\start_proc.bat ) goto :EOF :no_fi

RE: nt script

2003-07-01 Thread Smith, Ron L.
Write your daily file to a 'nodate' file. Then copy it to a date file for backup. Run your script against the 'nodate' file. Ron -Original Message- Sent: Tuesday, July 01, 2003 2:51 PM To: Multiple recipients of list ORACLE-L Bob, I tested it out, it works on one hard code file. If I

RE: nt script

2003-07-01 Thread Seefelt, Beth
Correct. FORFILES will not work. -Original Message- Sent: Tuesday, July 01, 2003 3:20 PM To: Multiple recipients of list ORACLE-L Hi Seefelt, with or without match, I added ORA-03113 and deleted it later to test both case. They all run ERRORLEVERL 1 condition. No matter what. Joan

Re: nt script

2003-07-01 Thread Joan Hsieh
Bob, I tested it out, it works on one hard code file. If I set thisfile it works. But in reality, I need to find today's log, the log file name convention is always goes psprcsrv_psnt_0701.log with the date suffix to the end. I can't hard code the file name in the bat file. Is there anyway how to

RE: nt script

2003-07-01 Thread Seefelt, Beth
Small correction FOR /F %x in ('dir /b /od d:\pslogs_psfm\fmdev8\_psprcsrvlog\*.log') do FIND "ORA-03313" %~fx if errorlevel 1 ( echo 'there is a match' d:\start_proc.bat ) goto :EOF And when you use FOR in a bat file, you have to replace all % with %% -Original Mes

RE: nt script

2003-07-01 Thread Seefelt, Beth
Yes. FOR /F %x in ('dir /b /od d:\pslogs_psfm\fmdev8\_psprcsrvlog\*.log') do FIND "ORA-03313" %x if errorlevel 1 ( echo 'there is a match' d:\start_proc.bat ) goto :EOF What this does is list each file in order of oldest to newest. It does the FIND on each one, but the

Re: nt script

2003-07-01 Thread Joan Hsieh
Hi Seefelt, with or without match, I added ORA-03113 and deleted it later to test both case. They all run ERRORLEVERL 1 condition. No matter what. Joan CODE: FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -c"CMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113" IF ERRORLEVEL 1 (

RE: nt script

2003-07-01 Thread Bob Metelsky
Don't run it line by line Save it to a file called myfind.bat Then call from a command prompt C:\> myfind.bat Or click the batch file, be sure to leave the pause so you can see an error if any. Once its working, you can then implemet blat as someone suggested Here is a version using variable

Re: nt script

2003-07-01 Thread Joan Hsieh
Hi Bob, thanks for the reply. I added your code and tested still no good. I tested the case without a match. Still go to run. Joan D:\oracle\admin>FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -c"CMD /c echo @FILE" PSPRCSRV_PSNT_0630.log PSPRCSRV_PSNT_0701.log D:\oracle\admin>e

Re: nt script

2003-07-01 Thread Joan Hsieh
Thanks Seefelt, I need to get the most recent log to check. There are more than 30 logs on that directory. I just check the most currenct one. That's why I use d+0 still it give me 2 files. Is there any way I can just get one file? Jon "Seefelt, Beth" wrote: > > Hi, > > I think FORFILES is p

RE: nt script

2003-07-01 Thread Seefelt, Beth
BTW, it can also be written like this. Just FYI. FINDSTR /S /I /L "ORA-03113" d:\pslogs_psfm\fmdev8\_psprcsrvlog\*.log if errorlevel 1 ( echo 'there is a match' d:\start_proc.bat ) goto :EOF -Original Message- Sent: Tuesday, July 01, 2003 12:35 PM To: [EMAIL PRO

RE: nt script

2003-07-01 Thread Seefelt, Beth
Hi, I think FORFILES is probably overkill here. And it probably is only going to return the errorlevel for the last file checked. Just use FINDSTR with a wildcard. FINDSTR /S /I /L "ORA-03113" d:\pslogs_psfm\fmdev8\_psprcsrvlog\*.log if errorlevel 1 goto run_proc echo 'there is a match' if er

Re: nt script

2003-07-01 Thread Joan Hsieh
I got it from http://www.ipass.net/davesisk/oont_download.htm [EMAIL PROTECTED] wrote: > > Joan: > > Where did you get the FORFILE.EXE program from? And, yes I will look at the > NT script. > > RWB > ===

Re: nt script

2003-07-01 Thread Reginald . W . Bailey
Joan: Where did you get the FORFILE.EXE program from? And, yes I will look at the NT script. RWB Reginald W. Bailey IBM Global Services - ETS SW GDSD - Database Management Your Friendly

RE: nt script

2003-07-01 Thread Bob Metelsky
echo off @cls find "ORA-124" C:\yourlog.txt >NUL IF ERRORLEVEL 1 GOTO no IF NOT ERRORLEVEL 1 GOTO yes :no ECHO NOT FOUND goto end :yes ECHO String IS found pause goto end :end exit > > Hi listers, > > I am working on a nt script. I download FORFILE exe, it works > fine. My intention i

RE: nt script

2003-03-12 Thread Niall Litchfield
: Multiple recipients of list ORACLE-LSubject: RE: nt script Thanks to all of you for your advice about learning Windows Shell Scripting. Suggestions were: - read Windows NT Shell Scripting by Tim Hill - http://www.calweb.com/~webspace/batch/index.htm - RTFH facility (help command at the DOS

RE: nt script

2003-03-10 Thread Jacques Kilchoer
Title: RE: nt script Thanks to all of you for your advice about learning Windows Shell Scripting. Suggestions were: - read Windows NT Shell Scripting by Tim Hill - http://www.calweb.com/~webspace/batch/index.htm - RTFH facility (help command at the DOS prompt) - Many useful NT commands are

Re: nt script

2003-03-08 Thread Jay
You might want to look at VBScript, it is easy to learn and can be executed on any Win platform. - Original Message - To: "Multiple recipients of list ORACLE-L" <[EMAIL PROTECTED]> Sent: Friday, March 07, 2003 2:48 PM > One bump you might encounter is some of the more useful NT shell com

RE: nt script

2003-03-07 Thread Branimir Petrovic
Title: RE: nt script Do yourself a favour - resist temptation of even considering DOS batch "language" (as it is nothing more than a horrid pile of I-won't-say-what;-)   Better choice is WSH and VBScript or JScript. Windows Scripting Host comes with every IE - therefor

RE: nt script

2003-03-07 Thread Darrell Landrum
One bump you might encounter is some of the more useful NT shell commands are only available from the NT resource kit. >>> [EMAIL PROTECTED] 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

RE: nt script

2003-03-07 Thread Kevin Lange
Title: RE: nt script If you just do a HELP COMMAND, where command is the name of the command you need help on, you can find out as much as you really need to know about BATCH.   In your sample of  FOR /F "TOKENS=1,2*" %%A IN ('DATE/T') DO SET DATE=%%B They were tryi

RE: nt script

2003-03-07 Thread Jeff Herrick
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 linewon't work. The opposite is also true...ask me how I know =8-) Jeff Herrick

RE: nt script

2003-03-07 Thread Darrell Landrum
Windows NT Shell Scripting by Tim Hill is a very good start. >>> [EMAIL PROTECTED] 03/07/03 12:34PM >>> 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 h

RE: nt script

2003-03-07 Thread Jamadagni, Rajendra
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

RE: nt script

2003-03-07 Thread Jacques Kilchoer
Title: 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*"

Re: nt script

2003-03-07 Thread Joan Hsieh
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!!! > >

Re: nt script

2003-03-07 Thread Jose Luis Delgado
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 ORAC

RE: NT Script ?

2001-06-27 Thread Kevin Kostyszyn
Tom, Yes I also recieved that script. However I thought about it, and for what I am doing, just scheduled exports of schemas, I don't need the seconds. All that I really need is the hour, but the minute comes in handy!! Thanks again:) Kev -Original Message- Thomas F Sent: Wednes

RE: RE: Horrifically, Vertiginously OT RE: NT Script

2001-06-27 Thread Mohan, Ross
Watch Out!! VENKATA APPARAO is sending out Viral attachments. I have mailed him already, but feel free to do so yourself! YIKES! -Original Message- Sent: Wednesday, June 27, 2001 12:34 PM To: [EMAIL PROTECTED] 'Mohan, Ross' wrote: - LoL! - - Every sect needs its special liqu

RE: NT Script ?

2001-06-27 Thread Mercadante, Thomas F
Kevin, did you see Bruce's script he sent on Tuesday? It does exactly what you want (and what I didn't know how to do!). It is included below - thanks Bruce - I tried it and it works like a charm. Who says we need Perl (Jared) :) Tom Mercadante Oracle Certified Professional -Origina

RE: NT Script ?

2001-06-27 Thread Kevin Kostyszyn
Once again Tom, can't thank you enough for this:) KK -Original Message- Thomas F Sent: Wednesday, June 27, 2001 8:57 AM To: Multiple recipients of list ORACLE-L Kevin, Sorry, I thought I sent you what I had. The script below will return the hour and minute, but getting the seconds are

RE: NT Script ?

2001-06-27 Thread Mercadante, Thomas F
Kevin, Sorry, I thought I sent you what I had. The script below will return the hour and minute, but getting the seconds are difficult, unless you use a Perl script. Secondly, the script below does not distinguish between 8AM and 8PM - both are returned as 8, another reason that I don't think i

RE: NT Script ?

2001-06-26 Thread Reardon, Bruce (CALBBAY)
Kevin, As requested, and showing another way to get the date. If you don't want the seconds for the time you could use time /t. Regards, Bruce C:\batch> test_time.bat [08504789] [0604Mon] --- @echo off rem test_time.bat call :get_timestamp call :get_d

Re: NT Script

2001-06-19 Thread nlzanen1
Hi, If you spool the files from sqlplus you can add the following lines of code column datum new_value datum noprint select to_char(sysdate,'ddmm') datum from dual; spool file_name_&datum..lst Jack

RE: Horrifically, Vertiginously OT RE: NT Script

2001-06-18 Thread Mohan, Ross
ubject: Horrifically, Vertiginously OT RE: NT Script > > > > Wow, you have reproduced?!?!? > > > > :) > butto answer your provocative question: "Neither!" > > I was a consultant too. The lies...the deceit. The constant > learning of &qu

RE: Horrifically, Vertiginously OT RE: NT Script

2001-06-18 Thread Scott . Shafer
ipients of list ORACLE-L > Subject: Horrifically, Vertiginously OT RE: NT Script > > > > Wow, you have reproduced?!?!? > > > > :) > butto answer your provocative question: "Neither!" > > I was a consultant too. The lies...the deceit.

Horrifically, Vertiginously OT RE: NT Script

2001-06-18 Thread Mohan, Ross
Wow, you have reproduced?!?!? :) butto answer your provocative question: "Neither!" I was a consultant too. The lies...the deceit. The constant learning of "new tricks" favored by each "client". A different "job" every day. The anonymous calls...all the package bodies, many without

RE: Vertiginously OT RE: NT Script

2001-06-18 Thread Rachel Carmichael
knowing Ross, that was a deliberate choice of spelling :) >From: "Mercadante, Thomas F" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> >Subject: RE: Vertiginously OT RE: NT Script >Date: Mo

RE: Vertiginously OT RE: NT Script

2001-06-18 Thread Kevin Lange
Ross; Prety soon you are going to have enough p.p.p...s's to sink a battleship. Ain't political correctness fun. -Original Message- Sent: Monday, June 18, 2001 3:22 PM To: Multiple recipients of list ORACLE-L Yea, Paul, what gives? Are you saying that we should all just stop

RE: NT Script

2001-06-18 Thread Guidry, Chris
Hello, If you want to do this in a .BAT or .CMD file then: for /f "tokens=2-4 delims=-/ " %%i in ('date/t') do set filedate=%%i%%j%%k rename export%filedate%.exp HTH -- Chris J. Guidry P.Eng. ATCO Electric, Metering Services Phone: (780) 420-4142 Fax: (780) 420-3854 Email: [EMAIL PROTECTED]

RE: Vertiginously OT RE: NT Script

2001-06-18 Thread Kevin Kostyszyn
What the?:) -Original Message- Sent: Monday, June 18, 2001 4:22 PM To: Multiple recipients of list ORACLE-L Yea, Paul, what gives? Are you saying that we should all just stop learning, give up, FDISK /MBR our NT hard drives, Bobbetize our nether parts and head for the coast? Huh? Ar

Vertiginously OT RE: NT Script

2001-06-18 Thread Mohan, Ross
Yea, Paul, what gives? Are you saying that we should all just stop learning, give up, FDISK /MBR our NT hard drives, Bobbetize our nether parts and head for the coast? Huh? Are ya? Gawd, I wish Eric were here; he'd slap you around with the Barbie you so clearly need. :) (that was the oblig

RE: NT Script

2001-06-18 Thread Mercadante, Thomas F
Paul, Does that mean that we should never "stretch" and try and learn something new? I would prefer to have several scripting tools in my toolbox, rather than depend on knowing SqlPlus ONLY for scripting experience. While what you suggest is certainly clever, and probably works just fine, I enj

RE: NT Script

2001-06-18 Thread Paul Drake
Kevin. "Stick to what you are good at." Are you good in working with sqlplus? Leverage that skill into making your export .par file dynamic. Call an sqlplus script that produces (spools) either the export.bat (and include the file= in the command line) or the export.par file. In this manner,

RE: RE: NT Script

2001-06-18 Thread Mercadante, Thomas F
e- > From: Mercadante, Thomas F > Sent: Monday, June 18, 2001 1:47 PM > To: '[EMAIL PROTECTED]' > Cc: '[EMAIL PROTECTED]' > Subject: RE: NT Script > > Kevin > > Attached is a TODAY.BAT file that, when called, creates three >

RE: NT Script

2001-06-18 Thread Mercadante, Thomas F
Attachment(s) from this message have been deleted because they were named with one of the following extensions: ADE, ADP, BAS, BAT, CHM, CMD, COM, CPL, CRT, EXE, HLP, HTA, INF, INS, ISP, JS, JSE, LNK, MDE, MSC, MSI, MSP, MST, PCD, PIF, REG, SCR, SCT, SHS, URL, VB, VBE, VBS, WSC, WSF, WSH. These

Re: NT Script

2001-06-18 Thread Jim Walski
I did this on another server and can't remember the exact details, but it went something like this: 1) In SQLPlus create a rename.sql file with: Spool rename_export.bat select 'HOST REN export_file_name export_file_name_'||to_char(sysdate,'MMDD') FROM DUAL; spool off; 2) In your script

RE: NT script question ???

2001-06-05 Thread Gogala, Mladen
; >Reply-To: [EMAIL PROTECTED] >To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> >Subject: RE: NT script question ??? >Date: Mon, 04 Jun 2001 16:20:49 -0800 > >Go to http://www.activestate.com, get perl, DBI & DBD::Oracle and you'll >have all the cripting t

RE: NT script question ???

2001-06-04 Thread Rachel Carmichael
cripting tools? Mladen, is that some new Egyptian software? >From: "Gogala, Mladen" <[EMAIL PROTECTED]> >Reply-To: [EMAIL PROTECTED] >To: Multiple recipients of list ORACLE-L <[EMAIL PROTECTED]> >Subject: RE: NT script question ??? >Date: Mon, 04

RE: NT script question ???

2001-06-04 Thread Gogala, Mladen
Go to http://www.activestate.com, get perl, DBI & DBD::Oracle and you'll have all the cripting tools that you'll ever need. Associative arrays, state of the art reuglar expressions, functions, format commands and well documented ways of accessing the oracle database from within a script (O'Reilly

RE: NT script and NT Script resources

2001-06-03 Thread Reardon, Bruce (CALBBAY)
Andrea, See the delete_oldfiles.bat I posted for an example of checking for a parameter. Do something like IF "%1"=="" echo No parameter 1 passed. Books I haven't tried these but some have suggested: Windows Admin Scripting Little Black Book By Jesse Torres Windows NT Shell Scripting Mac

RE: NT script question ???

2001-06-03 Thread Reardon, Bruce (CALBBAY)
Andrew, Batch parameters are referred to as %1, %2 etc %0 is the name of the calling command. %* refers to all parameters You can use the shift command to move parameters (do help shift) As an example: C:\batch>type param_test.bat @echo off echo %1 echo %2 echo %0 echo %* C:\batch> C:\batch> C:\