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
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
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
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
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
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
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
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
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
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
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
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
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 (
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
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
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
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
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
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
> ===
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
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
: 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
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
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
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
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
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
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
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
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
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*"
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!!!
>
>
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
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
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
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
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
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
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
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
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
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.
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
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
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
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]
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
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
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
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,
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
>
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
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
;
>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
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
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
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
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:\
58 matches
Mail list logo