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 platform.
-Original Message-
Sent: Tuesday, July 01, 2003 5:07 PM
To: Multiple recipients of list
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
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 is
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
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
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
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
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\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s
-m*.log -d+0 -cCMD /c echo @FILE
PSPRCSRV_PSNT_0630.log
PSPRCSRV_PSNT_0701.log
D:\oracle\adminecho
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
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 -cCMD
/c type d:[EMAIL PROTECTED]|findstr ORA-03113
IF ERRORLEVEL 1 (
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
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
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
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
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
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_file
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
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 EXIST
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
: 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 not know the
current status...
anyway
: 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
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
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
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* %%A IN ('DATE/T') DO
Title: RE: nt script
I have found http://www.calweb.com/~webspace/batch/index.htmto
be useful.
Raj
-
Rajendra dot Jamadagni at espn dot
com Any views expressed here are
strictly personal. QOTD: Any clod can
have facts, having
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 have
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
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 trying to set
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 when
Title: RE: nt script
Do yourself a
favour - resist temptation of even considering DOS batch "language" (as it
isnothing morethan a horrid pile of I-won't-say-what;-)
Better
choiceis WSH and VBScript or JScript. Windows Scripting Host comes with
every IE - therefore every Windo
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
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
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
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
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:
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
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
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
: 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
environmental variables (Month, day and Year) for your use.
In another BAT file, simply
call today.bat
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=path in the command line)
or the export.par file.
In this
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
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
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?
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 filename export%filedate%.exp
HTH
--
Chris J. Guidry P.Eng.
ATCO Electric, Metering Services
Phone: (780) 420-4142
Fax: (780) 420-3854
Email: [EMAIL
mock horror on
Wow, you have reproduced?!?!?
mock horror off
:)
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
, Vertiginously OT RE: NT Script
mock horror on
Wow, you have reproduced?!?!?
mock horror off
:)
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
]
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 tools that you'll ever need. Associative arrays,
state
of the art
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
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 Jun 2001 16:20:49 -0800
Go to http://www.activestate.com
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:\batchtype param_test.bat
@echo off
echo %1
echo %2
echo %0
echo %*
C:\batch
C:\batch
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
52 matches
Mail list logo