Re: nt script
After fix this problem. I am done with this. LEARN PERL. [EMAIL PROTECTED] wrote: Learn Perl and forget this ugly MS batch stuff. It's such a kludge. Seefelt, Beth [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 07/01/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 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 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), EXCEPT that you HAVE to change this line: FIND ORA-03313 psprcsrv_psnt_%MMDD%.log with this one: FINDSTR ORA-03313 psprcsrv_psnt_%MMDD%.log HTH JL there you go... (modify at your own needs...) copy con test.cmd findstr %1 alert_develop.log if errorlevel 1 goto no if errorlevel 0 goto si :no echo no se encontr#8804; la cadena: %1 goto fin :si echo si se encontr#8804; la cadena: %1 :fin ctrl-Z --- Seefelt, Beth [EMAIL PROTECTED] 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_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 echo Can't find todays log! exit /b 2 -Original Message- Sent: Tuesday, July 01, 2003 3:51 PM To: Multiple recipients of list ORACLE-L 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 get around with this? Thanks, Joan Bob Metelsky wrote: 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 variables ## [myfind.bat] :: Find example by BMetelsky on Friday-April-11-2003-9:22:53 AM :: This script searches thefile for a string and if it finds it, sends an email message to dbamail :: 0 =is found echo off set themess=A Database SERVICE on %computername% is NOT running on %date% at %time% set [EMAIL PROTECTED] set blatfile=D:\dbmon\blattext.txt set thefile=D:\dbmon\runit.log set subject=A DB SERVICE IS NOT RUNNING set [EMAIL PROTECTED] echo starting %blatfile% find ERROR: %thefile% NUL IF ERRORLEVEL 1 GOTO no IF NOT ERRORLEVEL 1 GOTO yes :no goto end :yes echo A db service is down on %computername%%blatfile% blat D:\dbmon\blattext.txt -subject %subject% -to %dbamail% -i %from% -body %themess% goto end :end @exit rem echo %errorlevel% ## 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 on D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\p [EMAIL PROTECTED]|findstr ORA-03113 NUL D:\oracle\adminIF ERRORLEVEL 1 GOTO no D:\oracle\adminIF NOT ERRORLEVEL 1 GOTO RUN_PROC D:\oracle\adminrem d:\psfm\start_proc_sched.bat D:\oracle\adminecho run run D:\oracle\adminpause Press any key to continue . . . D:\oracle\admingoto end D:\oracle\adminecho finished finished D:\oracle\adminrem if errorlevel 1 @d:\psfm\start_proc_sched.bat Bob Metelsky wrote: 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
Re: nt script
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_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 echo Can't find todays log! exit /b 2 -Original Message- Sent: Tuesday, July 01, 2003 3:51 PM To: Multiple recipients of list ORACLE-L 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 get around with this? Thanks, Joan Bob Metelsky wrote: 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 variables ## [myfind.bat] :: Find example by BMetelsky on Friday-April-11-2003-9:22:53 AM :: This script searches thefile for a string and if it finds it, sends an email message to dbamail :: 0 =is found echo off set themess=A Database SERVICE on %computername% is NOT running on %date% at %time% set [EMAIL PROTECTED] set blatfile=D:\dbmon\blattext.txt set thefile=D:\dbmon\runit.log set subject=A DB SERVICE IS NOT RUNNING set [EMAIL PROTECTED] echo starting %blatfile% find ERROR: %thefile% NUL IF ERRORLEVEL 1 GOTO no IF NOT ERRORLEVEL 1 GOTO yes :no goto end :yes echo A db service is down on %computername%%blatfile% blat D:\dbmon\blattext.txt -subject %subject% -to %dbamail% -i %from% -body %themess% goto end :end @exit rem echo %errorlevel% ## 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 on D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\p [EMAIL PROTECTED]|findstr ORA-03113 NUL D:\oracle\adminIF ERRORLEVEL 1 GOTO no D:\oracle\adminIF NOT ERRORLEVEL 1 GOTO RUN_PROC D:\oracle\adminrem d:\psfm\start_proc_sched.bat D:\oracle\adminecho run run D:\oracle\adminpause Press any key to continue . . . D:\oracle\admingoto end D:\oracle\adminecho finished finished D:\oracle\adminrem if errorlevel 1 @d:\psfm\start_proc_sched.bat Bob Metelsky wrote: 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 finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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
nt script
Hi listers, I am working on a nt script. I download FORFILE exe, it works fine. My intention is finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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).
RE: nt script
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 finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Bob Metelsky 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).
Re: nt script
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 Neighborhood DBA 713-216-7703 (Office) 281-798-5474 (Mobile) 713-415-5410 (Pager) [EMAIL PROTECTED] [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: 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).
Re: nt script
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 Reginald W. Bailey IBM Global Services - ETS SW GDSD - Database Management Your Friendly Neighborhood DBA 713-216-7703 (Office) 281-798-5474 (Mobile) 713-415-5410 (Pager) [EMAIL PROTECTED] [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: 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).
RE: nt script
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 errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end HTH. -Original Message- Sent: Tuesday, July 01, 2003 12:15 PM To: Multiple recipients of list ORACLE-L Hi listers, I am working on a nt script. I download FORFILE exe, it works fine. My intention is finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Seefelt, Beth 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).
Re: nt script
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 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 errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end HTH. -Original Message- Sent: Tuesday, July 01, 2003 12:15 PM To: Multiple recipients of list ORACLE-L Hi listers, I am working on a nt script. I download FORFILE exe, it works fine. My intention is finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Seefelt, Beth 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).
Re: nt script
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 on D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\p [EMAIL PROTECTED]|findstr ORA-03113 NUL D:\oracle\adminIF ERRORLEVEL 1 GOTO no D:\oracle\adminIF NOT ERRORLEVEL 1 GOTO RUN_PROC D:\oracle\adminrem d:\psfm\start_proc_sched.bat D:\oracle\adminecho run run D:\oracle\adminpause Press any key to continue . . . D:\oracle\admingoto end D:\oracle\adminecho finished finished D:\oracle\adminrem if errorlevel 1 @d:\psfm\start_proc_sched.bat Bob Metelsky wrote: 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 finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Bob Metelsky 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).
RE: nt script
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 variables ## [myfind.bat] :: Find example by BMetelsky on Friday-April-11-2003-9:22:53 AM :: This script searches thefile for a string and if it finds it, sends an email message to dbamail :: 0 =is found echo off set themess=A Database SERVICE on %computername% is NOT running on %date% at %time% set [EMAIL PROTECTED] set blatfile=D:\dbmon\blattext.txt set thefile=D:\dbmon\runit.log set subject=A DB SERVICE IS NOT RUNNING set [EMAIL PROTECTED] echo starting %blatfile% find ERROR: %thefile% NUL IF ERRORLEVEL 1 GOTO no IF NOT ERRORLEVEL 1 GOTO yes :no goto end :yes echo A db service is down on %computername%%blatfile% blat D:\dbmon\blattext.txt -subject %subject% -to %dbamail% -i %from% -body %themess% goto end :end @exit rem echo %errorlevel% ## 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 on D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\p [EMAIL PROTECTED]|findstr ORA-03113 NUL D:\oracle\adminIF ERRORLEVEL 1 GOTO no D:\oracle\adminIF NOT ERRORLEVEL 1 GOTO RUN_PROC D:\oracle\adminrem d:\psfm\start_proc_sched.bat D:\oracle\adminecho run run D:\oracle\adminpause Press any key to continue . . . D:\oracle\admingoto end D:\oracle\adminecho finished finished D:\oracle\adminrem if errorlevel 1 @d:\psfm\start_proc_sched.bat Bob Metelsky wrote: 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 finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Bob Metelsky 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
Re: nt script
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 ( echo 'there is no match' ) goto :no IF NOT ERRORLEVEL 1 (echp 'there is a match') GOTO :RUN_PROC :run_proc rem d:\psfm\start_proc_sched.bat echo run pause goto end :no echo do nothing TEST RUN WITHOUT MATCH; 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 on D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\ [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslo [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\adminIF ERRORLEVEL 1 (echo 'there is no match' ) D:\oracle\admingoto :no D:\oracle\adminecho do nothing do nothing D:\oracle\admingoto end D:\oracle\adminecho finished finished TEST RUN WITH A MATCH; D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 ORA-03113 D:\oracle\adminIF ERRORLEVEL 1 (echo 'there is no match' ) D:\oracle\admingoto :no D:\oracle\adminecho do nothing do nothing D:\oracle\admingoto end D:\oracle\adminecho finished finished Seefelt, Beth wrote: 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 PROTECTED] 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 errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end HTH. -Original Message- Sent: Tuesday, July 01, 2003 12:15 PM To: Multiple recipients of list ORACLE-L Hi listers, I am working on a nt script. I download FORFILE exe, it works fine. My intention is finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Seefelt, Beth 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
RE: nt script
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 errorlevel is only reported for the *last* one which will be the latest file. It will not traverse the subdirectories though. HTH. -Original Message- Sent: Tuesday, July 01, 2003 2:05 PM To: Multiple recipients of list ORACLE-L 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 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 errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end HTH. -Original Message- Sent: Tuesday, July 01, 2003 12:15 PM To: Multiple recipients of list ORACLE-L Hi listers, I am working on a nt script. I download FORFILE exe, it works fine. My intention is finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Seefelt, Beth 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Seefelt, Beth 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).
RE: nt script
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 Message- Sent: Tuesday, July 01, 2003 2:18 PM To: [EMAIL PROTECTED] 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 errorlevel is only reported for the *last* one which will be the latest file. It will not traverse the subdirectories though. HTH. -Original Message- Sent: Tuesday, July 01, 2003 2:05 PM To: Multiple recipients of list ORACLE-L 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 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 errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end HTH. -Original Message- Sent: Tuesday, July 01, 2003 12:15 PM To: Multiple recipients of list ORACLE-L Hi listers, I am working on a nt script. I download FORFILE exe, it works fine. My intention is finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Seefelt, Beth 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Seefelt, Beth 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
Re: nt script
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 get around with this? Thanks, Joan Bob Metelsky wrote: 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 variables ## [myfind.bat] :: Find example by BMetelsky on Friday-April-11-2003-9:22:53 AM :: This script searches thefile for a string and if it finds it, sends an email message to dbamail :: 0 =is found echo off set themess=A Database SERVICE on %computername% is NOT running on %date% at %time% set [EMAIL PROTECTED] set blatfile=D:\dbmon\blattext.txt set thefile=D:\dbmon\runit.log set subject=A DB SERVICE IS NOT RUNNING set [EMAIL PROTECTED] echo starting %blatfile% find ERROR: %thefile% NUL IF ERRORLEVEL 1 GOTO no IF NOT ERRORLEVEL 1 GOTO yes :no goto end :yes echo A db service is down on %computername%%blatfile% blat D:\dbmon\blattext.txt -subject %subject% -to %dbamail% -i %from% -body %themess% goto end :end @exit rem echo %errorlevel% ## 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 on D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\p [EMAIL PROTECTED]|findstr ORA-03113 NUL D:\oracle\adminIF ERRORLEVEL 1 GOTO no D:\oracle\adminIF NOT ERRORLEVEL 1 GOTO RUN_PROC D:\oracle\adminrem d:\psfm\start_proc_sched.bat D:\oracle\adminecho run run D:\oracle\adminpause Press any key to continue . . . D:\oracle\admingoto end D:\oracle\adminecho finished finished D:\oracle\adminrem if errorlevel 1 @d:\psfm\start_proc_sched.bat Bob Metelsky wrote: 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 finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Bob Metelsky 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
RE: nt script
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 CODE: FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 IF ERRORLEVEL 1 ( echo 'there is no match' ) goto :no IF NOT ERRORLEVEL 1 (echp 'there is a match') GOTO :RUN_PROC :run_proc rem d:\psfm\start_proc_sched.bat echo run pause goto end :no echo do nothing TEST RUN WITHOUT MATCH; 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 on D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\ [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslo [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\adminIF ERRORLEVEL 1 (echo 'there is no match' ) D:\oracle\admingoto :no D:\oracle\adminecho do nothing do nothing D:\oracle\admingoto end D:\oracle\adminecho finished finished TEST RUN WITH A MATCH; D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 ORA-03113 D:\oracle\adminIF ERRORLEVEL 1 (echo 'there is no match' ) D:\oracle\admingoto :no D:\oracle\adminecho do nothing do nothing D:\oracle\admingoto end D:\oracle\adminecho finished finished Seefelt, Beth wrote: 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 PROTECTED] 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 errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end HTH. -Original Message- Sent: Tuesday, July 01, 2003 12:15 PM To: Multiple recipients of list ORACLE-L Hi listers, I am working on a nt script. I download FORFILE exe, it works fine. My intention is finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Seefelt, Beth 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
RE: nt script
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 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 get around with this? Thanks, Joan Bob Metelsky wrote: 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 variables ## [myfind.bat] :: Find example by BMetelsky on Friday-April-11-2003-9:22:53 AM :: This script searches thefile for a string and if it finds it, sends an email message to dbamail :: 0 =is found echo off set themess=A Database SERVICE on %computername% is NOT running on %date% at %time% set [EMAIL PROTECTED] set blatfile=D:\dbmon\blattext.txt set thefile=D:\dbmon\runit.log set subject=A DB SERVICE IS NOT RUNNING set [EMAIL PROTECTED] echo starting %blatfile% find ERROR: %thefile% NUL IF ERRORLEVEL 1 GOTO no IF NOT ERRORLEVEL 1 GOTO yes :no goto end :yes echo A db service is down on %computername%%blatfile% blat D:\dbmon\blattext.txt -subject %subject% -to %dbamail% -i %from% -body %themess% goto end :end @exit rem echo %errorlevel% ## 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 on D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\p [EMAIL PROTECTED]|findstr ORA-03113 NUL D:\oracle\adminIF ERRORLEVEL 1 GOTO no D:\oracle\adminIF NOT ERRORLEVEL 1 GOTO RUN_PROC D:\oracle\adminrem d:\psfm\start_proc_sched.bat D:\oracle\adminecho run run D:\oracle\adminpause Press any key to continue . . . D:\oracle\admingoto end D:\oracle\adminecho finished finished D:\oracle\adminrem if errorlevel 1 @d:\psfm\start_proc_sched.bat Bob Metelsky wrote: 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 finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Bob Metelsky INET: [EMAIL PROTECTED] Fat City Network Services-- 858-538-5051 http://www.fatcity.com San Diego, California-- Mailing list and web hosting services
RE: nt script
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 echo Can't find todays log! exit /b 2 -Original Message- Sent: Tuesday, July 01, 2003 3:51 PM To: Multiple recipients of list ORACLE-L 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 get around with this? Thanks, Joan Bob Metelsky wrote: 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 variables ## [myfind.bat] :: Find example by BMetelsky on Friday-April-11-2003-9:22:53 AM :: This script searches thefile for a string and if it finds it, sends an email message to dbamail :: 0 =is found echo off set themess=A Database SERVICE on %computername% is NOT running on %date% at %time% set [EMAIL PROTECTED] set blatfile=D:\dbmon\blattext.txt set thefile=D:\dbmon\runit.log set subject=A DB SERVICE IS NOT RUNNING set [EMAIL PROTECTED] echo starting %blatfile% find ERROR: %thefile% NUL IF ERRORLEVEL 1 GOTO no IF NOT ERRORLEVEL 1 GOTO yes :no goto end :yes echo A db service is down on %computername%%blatfile% blat D:\dbmon\blattext.txt -subject %subject% -to %dbamail% -i %from% -body %themess% goto end :end @exit rem echo %errorlevel% ## 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 on D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\p [EMAIL PROTECTED]|findstr ORA-03113 NUL D:\oracle\adminIF ERRORLEVEL 1 GOTO no D:\oracle\adminIF NOT ERRORLEVEL 1 GOTO RUN_PROC D:\oracle\adminrem d:\psfm\start_proc_sched.bat D:\oracle\adminecho run run D:\oracle\adminpause Press any key to continue . . . D:\oracle\admingoto end D:\oracle\adminecho finished finished D:\oracle\adminrem if errorlevel 1 @d:\psfm\start_proc_sched.bat Bob Metelsky wrote: 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 finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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). -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Bob Metelsky
RE: nt script
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), EXCEPT that you HAVE to change this line: FIND ORA-03313 psprcsrv_psnt_%MMDD%.log with this one: FINDSTR ORA-03313 psprcsrv_psnt_%MMDD%.log HTH JL there you go... (modify at your own needs...) copy con test.cmd findstr %1 alert_develop.log if errorlevel 1 goto no if errorlevel 0 goto si :no echo no se encontr#8804; la cadena: %1 goto fin :si echo si se encontr#8804; la cadena: %1 :fin ctrl-Z --- Seefelt, Beth [EMAIL PROTECTED] 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_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 echo Can't find todays log! exit /b 2 -Original Message- Sent: Tuesday, July 01, 2003 3:51 PM To: Multiple recipients of list ORACLE-L 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 get around with this? Thanks, Joan Bob Metelsky wrote: 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 variables ## [myfind.bat] :: Find example by BMetelsky on Friday-April-11-2003-9:22:53 AM :: This script searches thefile for a string and if it finds it, sends an email message to dbamail :: 0 =is found echo off set themess=A Database SERVICE on %computername% is NOT running on %date% at %time% set [EMAIL PROTECTED] set blatfile=D:\dbmon\blattext.txt set thefile=D:\dbmon\runit.log set subject=A DB SERVICE IS NOT RUNNING set [EMAIL PROTECTED] echo starting %blatfile% find ERROR: %thefile% NUL IF ERRORLEVEL 1 GOTO no IF NOT ERRORLEVEL 1 GOTO yes :no goto end :yes echo A db service is down on %computername%%blatfile% blat D:\dbmon\blattext.txt -subject %subject% -to %dbamail% -i %from% -body %themess% goto end :end @exit rem echo %errorlevel% ## 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 on D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\p [EMAIL PROTECTED]|findstr ORA-03113 NUL D:\oracle\adminIF ERRORLEVEL 1 GOTO no D:\oracle\adminIF NOT ERRORLEVEL 1 GOTO RUN_PROC D:\oracle\adminrem d:\psfm\start_proc_sched.bat D:\oracle\adminecho run run D:\oracle\adminpause Press any key to continue . . . D:\oracle\admingoto end D:\oracle\adminecho finished finished D:\oracle\adminrem if errorlevel 1 @d:\psfm\start_proc_sched.bat Bob Metelsky wrote: 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 finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo
Re: nt script
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 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 echo Can't find todays log! exit /b 2 -Original Message- Sent: Tuesday, July 01, 2003 3:51 PM To: Multiple recipients of list ORACLE-L 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 get around with this? Thanks, Joan Bob Metelsky wrote: 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 variables ## [myfind.bat] :: Find example by BMetelsky on Friday-April-11-2003-9:22:53 AM :: This script searches thefile for a string and if it finds it, sends an email message to dbamail :: 0 =is found echo off set themess=A Database SERVICE on %computername% is NOT running on %date% at %time% set [EMAIL PROTECTED] set blatfile=D:\dbmon\blattext.txt set thefile=D:\dbmon\runit.log set subject=A DB SERVICE IS NOT RUNNING set [EMAIL PROTECTED] echo starting %blatfile% find ERROR: %thefile% NUL IF ERRORLEVEL 1 GOTO no IF NOT ERRORLEVEL 1 GOTO yes :no goto end :yes echo A db service is down on %computername%%blatfile% blat D:\dbmon\blattext.txt -subject %subject% -to %dbamail% -i %from% -body %themess% goto end :end @exit rem echo %errorlevel% ## 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 on D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\p [EMAIL PROTECTED]|findstr ORA-03113 NUL D:\oracle\adminIF ERRORLEVEL 1 GOTO no D:\oracle\adminIF NOT ERRORLEVEL 1 GOTO RUN_PROC D:\oracle\adminrem d:\psfm\start_proc_sched.bat D:\oracle\adminecho run run D:\oracle\adminpause Press any key to continue . . . D:\oracle\admingoto end D:\oracle\adminecho finished finished D:\oracle\adminrem if errorlevel 1 @d:\psfm\start_proc_sched.bat Bob Metelsky wrote: 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 finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks, Joan FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:[EMAIL PROTECTED]|findstr ORA-03113 if errorlevel 1 goto run_proc echo 'there is a match' if errorlevel 0 goto end echo 'there is no match' :run_proc d:\start_proc.bat goto end :end -- 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
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 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), EXCEPT that you HAVE to change this line: FIND ORA-03313 psprcsrv_psnt_%MMDD%.log with this one: FINDSTR ORA-03313 psprcsrv_psnt_%MMDD%.log HTH JL there you go... (modify at your own needs...) copy con test.cmd findstr %1 alert_develop.log if errorlevel 1 goto no if errorlevel 0 goto si :no echo no se encontr#8804; la cadena: %1 goto fin :si echo si se encontr#8804; la cadena: %1 :fin ctrl-Z --- Seefelt, Beth [EMAIL PROTECTED] 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_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 echo Can't find todays log! exit /b 2 -Original Message- Sent: Tuesday, July 01, 2003 3:51 PM To: Multiple recipients of list ORACLE-L 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 get around with this? Thanks, Joan Bob Metelsky wrote: 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 variables ## [myfind.bat] :: Find example by BMetelsky on Friday-April-11-2003-9:22:53 AM :: This script searches thefile for a string and if it finds it, sends an email message to dbamail :: 0 =is found echo off set themess=A Database SERVICE on %computername% is NOT running on %date% at %time% set [EMAIL PROTECTED] set blatfile=D:\dbmon\blattext.txt set thefile=D:\dbmon\runit.log set subject=A DB SERVICE IS NOT RUNNING set [EMAIL PROTECTED] echo starting %blatfile% find ERROR: %thefile% NUL IF ERRORLEVEL 1 GOTO no IF NOT ERRORLEVEL 1 GOTO yes :no goto end :yes echo A db service is down on %computername%%blatfile% blat D:\dbmon\blattext.txt -subject %subject% -to %dbamail% -i %from% -body %themess% goto end :end @exit rem echo %errorlevel% ## 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 on D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\p [EMAIL PROTECTED]|findstr ORA-03113 NUL D:\oracle\adminIF ERRORLEVEL 1 GOTO no D:\oracle\adminIF NOT ERRORLEVEL 1 GOTO RUN_PROC D:\oracle\adminrem d:\psfm\start_proc_sched.bat D:\oracle\adminecho run run D:\oracle\adminpause Press any key to continue . . . D:\oracle\admingoto end D:\oracle\adminecho finished finished D:\oracle\adminrem if errorlevel 1 @d:\psfm\start_proc_sched.bat Bob Metelsky wrote: 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 finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do nothing. I don't have problem with the findstr part. However, the errorlevel always return 0, no matter it find the error or not. So the if statement is not working. Can somebody give me some light on NT syntax? On unix, it is so easy to script the condition. Please help, Thanks
RE: nt script
Learn Perl and forget this ugly MS batch stuff. It's such a kludge. Seefelt, Beth [EMAIL PROTECTED] Sent by: [EMAIL PROTECTED] 07/01/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 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 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), EXCEPT that you HAVE to change this line: FIND ORA-03313 psprcsrv_psnt_%MMDD%.log with this one: FINDSTR ORA-03313 psprcsrv_psnt_%MMDD%.log HTH JL there you go... (modify at your own needs...) copy con test.cmd findstr %1 alert_develop.log if errorlevel 1 goto no if errorlevel 0 goto si :no echo no se encontr#8804; la cadena: %1 goto fin :si echo si se encontr#8804; la cadena: %1 :fin ctrl-Z --- Seefelt, Beth [EMAIL PROTECTED] 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_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 echo Can't find todays log! exit /b 2 -Original Message- Sent: Tuesday, July 01, 2003 3:51 PM To: Multiple recipients of list ORACLE-L 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 get around with this? Thanks, Joan Bob Metelsky wrote: 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 variables ## [myfind.bat] :: Find example by BMetelsky on Friday-April-11-2003-9:22:53 AM :: This script searches thefile for a string and if it finds it, sends an email message to dbamail :: 0 =is found echo off set themess=A Database SERVICE on %computername% is NOT running on %date% at %time% set [EMAIL PROTECTED] set blatfile=D:\dbmon\blattext.txt set thefile=D:\dbmon\runit.log set subject=A DB SERVICE IS NOT RUNNING set [EMAIL PROTECTED] echo starting %blatfile% find ERROR: %thefile% NUL IF ERRORLEVEL 1 GOTO no IF NOT ERRORLEVEL 1 GOTO yes :no goto end :yes echo A db service is down on %computername%%blatfile% blat D:\dbmon\blattext.txt -subject %subject% -to %dbamail% -i %from% -body %themess% goto end :end @exit rem echo %errorlevel% ## 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 on D:\oracle\adminFORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\pslog [EMAIL PROTECTED]|findstr ORA-03113 D:\oracle\admin\test.log D:\oracle\adminrem FORFILES -pd:\pslogs_psfm\fmdev8\_psprcsrvlog\ -s -m*.log -d+0 -cCMD /c type d:\p [EMAIL PROTECTED]|findstr ORA-03113 NUL D:\oracle\adminIF ERRORLEVEL 1 GOTO no D:\oracle\adminIF NOT ERRORLEVEL 1 GOTO RUN_PROC D:\oracle\adminrem d:\psfm\start_proc_sched.bat D:\oracle\adminecho run run D:\oracle\adminpause Press any key to continue . . . D:\oracle\admingoto end D:\oracle\adminecho finished finished D:\oracle\adminrem if errorlevel 1 @d:\psfm\start_proc_sched.bat Bob Metelsky wrote: 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 finding the ORA-03113 string in the log. If there is a match, then reboot the server, else do
RE: nt script
Title: Message NB you can combine the last two since you can use activestate perl with wsh http://www.activestate.com/Products/ActivePerl/ -Original Message-From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jacques KilchoerSent: 10 March 2003 21:25To: 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 prompt) - Many useful NT commands are only available in the NT resource kit - Use Windows Scripting Host (comes with every IE - therefore every Windows machine) or VB Script or JScript. - Install another scripting language like Python or Perl.
RE: nt script
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 only available in the NT resource kit - Use Windows Scripting Host (comes with every IE - therefore every Windows machine) or VB Script or JScript. - Install another scripting language like Python or Perl.
Re: nt script
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 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 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 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:[EMAIL PROTECTED] 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 -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jeff Herrick 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: Darrell Landrum 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: Jay 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).
nt script
Hi Dear list; I don't have experience on NT scripting. but I have an urgent need for nt script. Someone's help would be appreciated. Here is the question; How to convert this script to nt script? I need to reboot the nt server if there is any error on this sql statement instead of paging someone on UNIX. Thanks a lot, Joan . $HOME/.profile echo Sending mail!!! dt=$(date '+%H%M_%m%d%y') export ORACLE_SID=FMRPT sqlplus / EOF! sqllog set heading off SELECT 'FMRPT PSNTRP02 SCHEDULER DOWN' FROM DUAL WHERE EXISTS (SELECT 'X' FROM PSSERVERSTAT WHERE SERVERNAME = 'PSNTRP02' AND SERVERSTATUS 3) OR NOT EXISTS (SELECT 'X' FROM PSSERVERSTAT WHERE SERVERNAME = 'PSNTRP02') UNION SELECT 'FMRPT PSNTRP03 SCHEDULER DOWN' FROM DUAL WHERE EXISTS (SELECT 'X' FROM PSSERVERSTAT WHERE SERVERNAME = 'PSNTRP03' AND SERVERSTATUS 3) OR NOT EXISTS (SELECT 'X' FROM PSSERVERSTAT WHERE SERVERNAME = 'PSNTRP03') ; exit EOF! cat sqllog |egrep 'DOWN' errfilelog cat sqllog | egrep -q 'DOWN' if [ $? -eq 0 ] # found at least one match then mailx -s 'FMRPT P.SCHEDULER IS DOWN' [EMAIL PROTECTED] errfilelog exit -1 fi -- 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).
Re: nt script
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).
RE: nt script
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 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:[EMAIL PROTECTED]] 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
RE: nt script
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 an opinion is an art !! -Original Message-From: Jacques Kilchoer [mailto:[EMAIL PROTECTED]Sent: Friday, March 07, 2003 1:34 PMTo: Multiple recipients of list ORACLE-LSubject: 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 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:[EMAIL PROTECTED]] 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=FMRPTsqlplus / 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 This e-mail message is confidential, intended only for the named recipient(s) above and may contain information that is privileged, attorney work product or exempt from disclosure under applicable law. If you have received this message in error, or are not the named recipient(s), please immediately notify corporate MIS at (860) 766-2000 and delete this e-mail message from your computer, Thank you.*2
RE: nt script
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 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:[EMAIL PROTECTED] 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 -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Darrell Landrum 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).
RE: nt script
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 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:[EMAIL PROTECTED] 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 -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jeff Herrick 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).
RE: nt script
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 a variable called DATE based on the system date. First of all , %%A should be %A and %%B should be %B if you are running this command in a command line. If you place it in a batch file the way you have it, it will work. First 2 values from the DATE/T command are placed in the variables %A and %B. Then, for each line returned in this command (1), you set the variable DATE equal to the second returned value (%B). For example, today the DATE/T returns 'Fri 03/07/2003". Therefore, %A gets set to FRI and %B gets set to 03/07/2003. When your command completes, the variable DATE will be equal to %B or 03/07/2003. -- This was determined by doing a help on the FOR command: help for FOR /F ["options"] %variable IN (file-set) DO command [command-parameters]FOR /F ["options"] %variable IN ("string") DO command [command-parameters]FOR /F ["options"] %variable IN ('command') DO command [command-parameters] or, if usebackq option present: FOR /F ["options"] %variable IN (file-set) DO command [command-parameters]FOR /F ["options"] %variable IN ('string') DO command [command-parameters]FOR /F ["options"] %variable IN (`command`) DO command [command-parameters] filenameset is one or more file names. Each file is opened, read and processed before going on to the next file in filenameset. Processing consists of reading in the file, breaking it up into individual lines of text and then parsing each line into zero or more tokens. The body of the for loop is then called with the variable value(s) set to the found token string(s). By default, /F passes the first blank separated token from each line of each file. Blank lines are skipped. You can override the default parsing behavior by specifying the optional "options" parameter. This is a quoted string which contains one or more keywords to specify different parsing options. The keywords are: eol=c - specifies an end of line comment character (just one) skip=n - specifies the number of lines to skip at the beginning of the file. delims=xxx - specifies a delimiter set. This replaces the default delimiter set of space and tab. tokens=x,y,m-n - specifies which tokens from each line are to be passed to the for body for each iteration. This will cause additional variable names to be allocated. The m-n form is a range, specifying the mth through the nth tokens. If the last character in the tokens= string is an asterisk, then an additional variable is allocated and receives the remaining text on the line after the last token parsed. usebackq - specifies that the new semantics are in force, where a back quoted string is executed as a command and a single quoted string is a literal string command and allows the use of double quotes to quote file names in filenameset.
RE: nt script
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 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 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:[EMAIL PROTECTED] 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 -- Please see the official ORACLE-L FAQ: http://www.orafaq.net -- Author: Jeff Herrick 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: Darrell Landrum 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).
RE: nt script
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 Windows machine. Should you go this way keep on mind that you will be painting yourself (using M$ proprietary paints) in corner with your own hands. It makes the most sense to choose cross platform scripting language then use it wherever you go. Down side - you'd have to ensure this particular scripting environment is installed on all platforms/systems you support. Python and Perl are twomature beasts that pack (more than) enough power, and yet are platform agnostic. Worth learning? You bet. Branimir -Original Message-From: Jacques Kilchoer [mailto:[EMAIL PROTECTED]Sent: March 7, 2003 1:34 PMTo: Multiple recipients of list ORACLE-LSubject: 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 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.
RE: NT Script ?
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 it is completely usefull. rem *** TOTIME.BAT * rem echo off IF NOT '%1'=='' GOTO SetEnvVars for /F delims=:,a,p tokens=1-4 %%i in ('time/T') do totime.BAT %%i %%j %%k %%l GOTO Done :SetEnvVars :: set DayOfWeek=%1 set Hour=%1 set Min=%2 set Sec=%3 :Done rem Below is a Perl script I use that created both date and time environmental variables. Run the Perl script, and then the Today.Bat file that it produces within the calling NT bat script to setup the environmental's. #Program Name : Today.pl #Author : Thomas Mercadante # 1/18/2000 #Purpose : This program will produce an NT BAT file that # may be called by other BAT programs to establish # an NT environmental variable that will contain # the following environmental variables: # # month Mmm Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec # day Ddd Mon, Tue Wed Thu Fri Sat Sun # year 2000 # time HHMMSS # date nn 1,2,3,4,5,6,7,8,9,10 etc # today Month_date_year # $time=localtime(time); @today=split(/ /,$time); $day=$today[0]; $month=$today[1]; $date=$today[2]; if ($date eq '') { $date=$today[3]; # $time=$today[4]; $year=$today[5]; @clock=split(/:/,$today[4]); $hour=$clock[0]; $min=$clock[1]; $sec=$clock[2]; } else { # $time=$today[3]; @clock=split(/:/,$today[3]); $hour=$clock[0]; $min=$clock[1]; $sec=$clock[2]; $year=$today[4]; } print \@set today=.$month. _ .$date. _ .$year. \n; print \@set month=.$month.\n; print \@set day=.$day.\n; print \@set year=.$year.\n; print \@set time=.$hour.$min.$sec. \n; print \@set date=.$date.\n; Hope these help. Tom Mercadante Oracle Certified Professional -Original Message- Sent: Tuesday, June 26, 2001 5:33 PM To: Multiple recipients of list ORACLE-L Hi all, Was wondering if anyone of the brains out there would know how to add the hour and minute to this beautiful little script that Tom Mercadante provided me with? Not that Tom couldn't do it himself, he just didn't, I didn't ask for it the first time that I requested such a script. Thanks again Tom, this will help me out beautifully:) rem rem echo off IF NOT '%1'=='' GOTO SetEnvVars for /F delims=/ tokens=1-4 %%i in ('date /t') do today.BAT %%i %%j %%k %%l GOTO Done :SetEnvVars :: set DayOfWeek=%1 set Month=%2 set Day=%3 set Year=%4 :Done rem Sincerely, Kevin Kostyszyn DBA Dulcian, Inc www.dulcian.com [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Kostyszyn INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Mercadante, Thomas F INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: NT Script ?
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 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 it is completely usefull. rem *** TOTIME.BAT * rem echo off IF NOT '%1'=='' GOTO SetEnvVars for /F delims=:,a,p tokens=1-4 %%i in ('time/T') do totime.BAT %%i %%j %%k %%l GOTO Done :SetEnvVars :: set DayOfWeek=%1 set Hour=%1 set Min=%2 set Sec=%3 :Done rem Below is a Perl script I use that created both date and time environmental variables. Run the Perl script, and then the Today.Bat file that it produces within the calling NT bat script to setup the environmental's. #Program Name : Today.pl #Author : Thomas Mercadante # 1/18/2000 #Purpose : This program will produce an NT BAT file that # may be called by other BAT programs to establish # an NT environmental variable that will contain # the following environmental variables: # # month Mmm Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec # day Ddd Mon, Tue Wed Thu Fri Sat Sun # year 2000 # time HHMMSS # date nn 1,2,3,4,5,6,7,8,9,10 etc # today Month_date_year # $time=localtime(time); @today=split(/ /,$time); $day=$today[0]; $month=$today[1]; $date=$today[2]; if ($date eq '') { $date=$today[3]; # $time=$today[4]; $year=$today[5]; @clock=split(/:/,$today[4]); $hour=$clock[0]; $min=$clock[1]; $sec=$clock[2]; } else { # $time=$today[3]; @clock=split(/:/,$today[3]); $hour=$clock[0]; $min=$clock[1]; $sec=$clock[2]; $year=$today[4]; } print \@set today=.$month. _ .$date. _ .$year. \n; print \@set month=.$month.\n; print \@set day=.$day.\n; print \@set year=.$year.\n; print \@set time=.$hour.$min.$sec. \n; print \@set date=.$date.\n; Hope these help. Tom Mercadante Oracle Certified Professional -Original Message- Sent: Tuesday, June 26, 2001 5:33 PM To: Multiple recipients of list ORACLE-L Hi all, Was wondering if anyone of the brains out there would know how to add the hour and minute to this beautiful little script that Tom Mercadante provided me with? Not that Tom couldn't do it himself, he just didn't, I didn't ask for it the first time that I requested such a script. Thanks again Tom, this will help me out beautifully:) rem rem echo off IF NOT '%1'=='' GOTO SetEnvVars for /F delims=/ tokens=1-4 %%i in ('date /t') do today.BAT %%i %%j %%k %%l GOTO Done :SetEnvVars :: set DayOfWeek=%1 set Month=%2 set Day=%3 set Year=%4 :Done rem Sincerely, Kevin Kostyszyn DBA Dulcian, Inc www.dulcian.com [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Kostyszyn INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Mercadante, Thomas F INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Kevin Kostyszyn INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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
RE: NT Script ?
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 -Original Message- [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 26, 2001 7:31 PM To: Multiple recipients of list ORACLE-L 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_datestamp goto :EOF ::: :get_timestamp :: get the time in format hhmmssxx, where 'xx' is hundredths of a second :: because want ssxx can not use time/t for /f tokens=1-8 delims=:. %%a in ('echo.^| time ^| find current') do ( set zhh=%%e set zmm=%%f set zss=%%g set zxx=%%h ) if 10 GTR %zhh% set zhh=0%zhh% :: assign the values to ztimefull set ztimefull=%zhh%%zmm%%zss%%zxx% echo [%ztimefull%] rem cleanup set zhh= set zmm= set zss= set zxx= goto :EOF ::: :get_datestamp :: get the time in format mmdd for /f tokens=1-8 delims=:.-/ %%a in ('echo.^| date ^| find current') do ( set z=%%h set zmm=%%g set zdd=%%f ) :: assign the values to zdatefull set zdatefull=%z%%zmm%%zdd% echo [%zdatefull%] rem cleanup set z= set zmm= set zdd= goto :EOF ::: -Original Message- Sent: Wednesday, 27 June 2001 7:33 To: Multiple recipients of list ORACLE-L Hi all, Was wondering if anyone of the brains out there would know how to add the hour and minute to this beautiful little script that Tom Mercadante provided me with? Not that Tom couldn't do it himself, he just didn't, I didn't ask for it the first time that I requested such a script. Thanks again Tom, this will help me out beautifully:) rem rem echo off IF NOT '%1'=='' GOTO SetEnvVars for /F delims=/ tokens=1-4 %%i in ('date /t') do today.BAT %%i %%j %%k %%l GOTO Done :SetEnvVars :: set DayOfWeek=%1 set Month=%2 set Day=%3 set Year=%4 :Done rem Sincerely, Kevin Kostyszyn DBA Dulcian, Inc www.dulcian.com [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Reardon, Bruce (CALBBAY) INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Mercadante, Thomas F INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: RE: Horrifically, Vertiginously OT RE: NT Script
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 liquid... - - water, wine, kool-aid, and my own personal favorite: single malt scrotch. - - - -Original Message- - [mailto:[EMAIL PROTECTED]] - Sent: Monday, June 18, 2001 5:46 PM - To: Multiple recipients of list ORACLE-L - - - Just sip the purple kool-aid... - - Scott Shafer - San Antonio, TX - 210-581-6217 - - I hate the country, all those animals walking around un-cooked. - - ...' Take a look to the attachment. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: NT Script ?
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: Wednesday, June 27, 2001 12:33 PM To: Multiple recipients of list ORACLE-L 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 -Original Message- [mailto:[EMAIL PROTECTED]] Sent: Tuesday, June 26, 2001 7:31 PM To: Multiple recipients of list ORACLE-L 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_datestamp goto :EOF ::: :get_timestamp :: get the time in format hhmmssxx, where 'xx' is hundredths of a second :: because want ssxx can not use time/t for /f tokens=1-8 delims=:. %%a in ('echo.^| time ^| find current') do ( set zhh=%%e set zmm=%%f set zss=%%g set zxx=%%h ) if 10 GTR %zhh% set zhh=0%zhh% :: assign the values to ztimefull set ztimefull=%zhh%%zmm%%zss%%zxx% echo [%ztimefull%] rem cleanup set zhh= set zmm= set zss= set zxx= goto :EOF ::: :get_datestamp :: get the time in format mmdd for /f tokens=1-8 delims=:.-/ %%a in ('echo.^| date ^| find current') do ( set z=%%h set zmm=%%g set zdd=%%f ) :: assign the values to zdatefull set zdatefull=%z%%zmm%%zdd% echo [%zdatefull%] rem cleanup set z= set zmm= set zdd= goto :EOF ::: -Original Message- Sent: Wednesday, 27 June 2001 7:33 To: Multiple recipients of list ORACLE-L Hi all, Was wondering if anyone of the brains out there would know how to add the hour and minute to this beautiful little script that Tom Mercadante provided me with? Not that Tom couldn't do it himself, he just didn't, I didn't ask for it the first time that I requested such a script. Thanks again Tom, this will help me out beautifully:) rem rem echo off IF NOT '%1'=='' GOTO SetEnvVars for /F delims=/ tokens=1-4 %%i in ('date /t') do today.BAT %%i %%j %%k %%l GOTO Done :SetEnvVars :: set DayOfWeek=%1 set Month=%2 set Day=%3 set Year=%4 :Done rem Sincerely, Kevin Kostyszyn DBA Dulcian, Inc www.dulcian.com [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Reardon, Bruce (CALBBAY) INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Mercadante, Thomas F INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Kevin Kostyszyn INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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
NT Script ?
Hi all, Was wondering if anyone of the brains out there would know how to add the hour and minute to this beautiful little script that Tom Mercadante provided me with? Not that Tom couldn't do it himself, he just didn't, I didn't ask for it the first time that I requested such a script. Thanks again Tom, this will help me out beautifully:) rem rem echo off IF NOT '%1'=='' GOTO SetEnvVars for /F delims=/ tokens=1-4 %%i in ('date /t') do today.BAT %%i %%j %%k %%l GOTO Done :SetEnvVars :: set DayOfWeek=%1 set Month=%2 set Day=%3 set Year=%4 :Done rem Sincerely, Kevin Kostyszyn DBA Dulcian, Inc www.dulcian.com [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Kostyszyn INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: NT Script ?
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_datestamp goto :EOF ::: :get_timestamp :: get the time in format hhmmssxx, where 'xx' is hundredths of a second :: because want ssxx can not use time/t for /f tokens=1-8 delims=:. %%a in ('echo.^| time ^| find current') do ( set zhh=%%e set zmm=%%f set zss=%%g set zxx=%%h ) if 10 GTR %zhh% set zhh=0%zhh% :: assign the values to ztimefull set ztimefull=%zhh%%zmm%%zss%%zxx% echo [%ztimefull%] rem cleanup set zhh= set zmm= set zss= set zxx= goto :EOF ::: :get_datestamp :: get the time in format mmdd for /f tokens=1-8 delims=:.-/ %%a in ('echo.^| date ^| find current') do ( set z=%%h set zmm=%%g set zdd=%%f ) :: assign the values to zdatefull set zdatefull=%z%%zmm%%zdd% echo [%zdatefull%] rem cleanup set z= set zmm= set zdd= goto :EOF ::: -Original Message- Sent: Wednesday, 27 June 2001 7:33 To: Multiple recipients of list ORACLE-L Hi all, Was wondering if anyone of the brains out there would know how to add the hour and minute to this beautiful little script that Tom Mercadante provided me with? Not that Tom couldn't do it himself, he just didn't, I didn't ask for it the first time that I requested such a script. Thanks again Tom, this will help me out beautifully:) rem rem echo off IF NOT '%1'=='' GOTO SetEnvVars for /F delims=/ tokens=1-4 %%i in ('date /t') do today.BAT %%i %%j %%k %%l GOTO Done :SetEnvVars :: set DayOfWeek=%1 set Month=%2 set Day=%3 set Year=%4 :Done rem Sincerely, Kevin Kostyszyn DBA Dulcian, Inc www.dulcian.com [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Reardon, Bruce (CALBBAY) INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
Re: NT Script
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 Kevin Kostyszyn To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] kevin@dulcian cc: .comSubject: NT Script Sent by: [EMAIL PROTECTED] om 18-06-2001 19:12 Please respond to ORACLE-L Hello all, I know, I know, NT. Anyway, I was wondering if anyone knew how to append the system date to a file created through a script. Basically, what I want to do is have files set up to run exports every night, however, I need to be able to appened the system date to the file when it is created so I don't just over write the file that was created the night before. Does anyone know how to do this, it would be greatly appreciated!! Sincerely, Kevin Kostyszyn DBA Dulcian, Inc www.dulcian.com [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Kostyszyn INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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). = De informatie verzonden in dit e-mailbericht is vertrouwelijk en is uitsluitend bestemd voor de geadresseerde. Openbaarmaking, vermenigvuldiging, verspreiding en/of verstrekking van deze informatie aan derden is, behoudens voorafgaande schriftelijke toestemming van Ernst Young, niet toegestaan. Ernst Young staat niet in voor de juiste en volledige overbrenging van de inhoud van een verzonden e-mailbericht, noch voor tijdige ontvangst daarvan. Ernst Young kan niet garanderen dat een verzonden e-mailbericht vrij is van virussen, noch dat e-mailberichten worden overgebracht zonder inbreuk of tussenkomst van onbevoegde derden. Indien bovenstaand e-mailbericht niet aan u is gericht, verzoeken wij u vriendelijk doch dringend het e-mailbericht te retourneren aan de verzender en het origineel en eventuele kopieën te verwijderen en te vernietigen. Ernst Young hanteert bij de uitoefening van haar werkzaamheden algemene voorwaarden, waarin een beperking van aansprakelijkheid is opgenomen. De algemene voorwaarden worden u op verzoek kosteloos toegezonden. = The information contained in this communication is confidential and is intended solely for the use of the individual or entity to whom it is addressed. You should not copy, disclose or distribute this communication without the authority of Ernst Young. Ernst Young is neither liable for the proper and complete transmission of the information contained in this communication nor for any delay in its receipt. Ernst Young does not guarantee that the integrity of this communication has been maintained nor that the communication is free of viruses
NT Script
Hello all, I know, I know, NT. Anyway, I was wondering if anyone knew how to append the system date to a file created through a script. Basically, what I want to do is have files set up to run exports every night, however, I need to be able to appened the system date to the file when it is created so I don't just over write the file that was created the night before. Does anyone know how to do this, it would be greatly appreciated!! Sincerely, Kevin Kostyszyn DBA Dulcian, Inc www.dulcian.com [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Kostyszyn INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
Re: NT Script
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 have two commands: sqlplus user/password start rename.sql call rename_export.bat HTH, Jim -Original Message- To: Multiple recipients of list ORACLE-L [EMAIL PROTECTED] Date: Monday, June 18, 2001 9:56 AM Hello all, I know, I know, NT. Anyway, I was wondering if anyone knew how to append the system date to a file created through a script. Basically, what I want to do is have files set up to run exports every night, however, I need to be able to appened the system date to the file when it is created so I don't just over write the file that was created the night before. Does anyone know how to do this, it would be greatly appreciated!! Sincerely, Kevin Kostyszyn DBA Dulcian, Inc www.dulcian.com [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Kostyszyn INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Jim Walski INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: RE: NT Script
Kevin, sorry, I got notified that the .BAT file was stripped. below is the text of the BAT file. Simply copy it into a notepad document, and name it TODAY.BAT rem rem echo off IF NOT '%1'=='' GOTO SetEnvVars for /F delims=/ tokens=1-4 %%i in ('date /t') do today.BAT %%i %%j %%k %%l GOTO Done :SetEnvVars :: set DayOfWeek=%1 set Month=%2 set Day=%3 set Year=%4 :Done rem Tom Mercadante Oracle Certified Professional -Original Message- 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 environmental variables (Month, day and Year) for your use. In another BAT file, simply call today.bat set export_file_name=export_%month%_%day%_%year%.dmp exp userid=u/pw@sid file=%export_file_name% hope this helps Tom Mercadante Oracle Certified Professional File: today.bat -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mercadante, Thomas F INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: NT Script
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 manner, you won't have to know every trick in the nt scripting world - and better yet - its a more cross-platform compatible methodology - for when you have to support Oracle on more than 1 OS. You could even execute the rename command via a HOST command in a sqlplus script. So you could simply export the database to the same filename each time, but rename it afterwards. Or you could compress the dump file(s) to a filename including the date. Let me know if you need direct examples - but I can't get to it today. Paul -Original Message- Sent: Monday, June 18, 2001 1:12 PM To: Multiple recipients of list ORACLE-L Hello all, I know, I know, NT. Anyway, I was wondering if anyone knew how to append the system date to a file created through a script. Basically, what I want to do is have files set up to run exports every night, however, I need to be able to appened the system date to the file when it is created so I don't just over write the file that was created the night before. Does anyone know how to do this, it would be greatly appreciated!! Sincerely, Kevin Kostyszyn DBA Dulcian, Inc www.dulcian.com [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Kostyszyn INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Paul Drake INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: NT Script
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 enjoy learning new stuff that makes me more valuable for any future engagements. (I'm a consultant, can you tell?). I've never been successfull answering the question: Do you have any experience in NT scripting with the answer: No, but I know SqlPlus Real Good! Just my opinion. Tom Mercadante Oracle Certified Professional -Original Message- Sent: Monday, June 18, 2001 2:46 PM To: Multiple recipients of list ORACLE-L 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 manner, you won't have to know every trick in the nt scripting world - and better yet - its a more cross-platform compatible methodology - for when you have to support Oracle on more than 1 OS. You could even execute the rename command via a HOST command in a sqlplus script. So you could simply export the database to the same filename each time, but rename it afterwards. Or you could compress the dump file(s) to a filename including the date. Let me know if you need direct examples - but I can't get to it today. Paul -Original Message- Sent: Monday, June 18, 2001 1:12 PM To: Multiple recipients of list ORACLE-L Hello all, I know, I know, NT. Anyway, I was wondering if anyone knew how to append the system date to a file created through a script. Basically, what I want to do is have files set up to run exports every night, however, I need to be able to appened the system date to the file when it is created so I don't just over write the file that was created the night before. Does anyone know how to do this, it would be greatly appreciated!! Sincerely, Kevin Kostyszyn DBA Dulcian, Inc www.dulcian.com [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Kostyszyn INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Paul Drake INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Mercadante, Thomas F INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
Vertiginously OT RE: NT Script
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 obligatory 'smiley', indicating humor) Ross p.s. btw, as a former conslutant, one thing i learned was, whenever my clients asked anything about oracle on NT, I just laughed cynically, shook my head disconsolately, and said NT? It'll never be scalable. It's really just a buggy piece of poop. p.p.s I just used the word poop because I was with my kids for the entire weekend. Many concepts in a young person's daily flow of events center around poop. It in no way reflects on my Rigidly Authoritarian Employer's view on life. p.p.p.s Even the phrase Rigidly Authoritarian Employer has nothing to do with my employer, workplace, co-workers, or stance on political correctness. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: Vertiginously OT RE: NT Script
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? Are ya? Gawd, I wish Eric were here; he'd slap you around with the Barbie you so clearly need. :) (that was the obligatory 'smiley', indicating humor) Ross p.s. btw, as a former conslutant, one thing i learned was, whenever my clients asked anything about oracle on NT, I just laughed cynically, shook my head disconsolately, and said NT? It'll never be scalable. It's really just a buggy piece of poop. p.p.s I just used the word poop because I was with my kids for the entire weekend. Many concepts in a young person's daily flow of events center around poop. It in no way reflects on my Rigidly Authoritarian Employer's view on life. p.p.p.s Even the phrase Rigidly Authoritarian Employer has nothing to do with my employer, workplace, co-workers, or stance on political correctness. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Kevin Kostyszyn INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: NT Script
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 PROTECTED] -Original Message- From: Kevin Kostyszyn [SMTP:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 11:12 AM To: Multiple recipients of list ORACLE-L Subject: NT Script Hello all, I know, I know, NT. Anyway, I was wondering if anyone knew how to append the system date to a file created through a script. Basically, what I want to do is have files set up to run exports every night, however, I need to be able to appened the system date to the file when it is created so I don't just over write the file that was created the night before. Does anyone know how to do this, it would be greatly appreciated!! Sincerely, Kevin Kostyszyn DBA Dulcian, Inc www.dulcian.com [EMAIL PROTECTED] -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Kevin Kostyszyn INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Guidry, Chris INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
Horrifically, 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. The anonymous calls...all the package bodies, many without hygienic wrappers...My tnslsnr had a port in every storm, and I denied service to no one. Pretty soon I had my own site, and was serving pages to anonymous users for cheap, second relationships. I even inserted records into distributed databases! I felt dirty, 100% used, 0% free, and cheap. After a while, I came to see the SQL*Error of my ways. I became a wage slave. I joined the fold. A group of like-minded people. People will values like my own..I received forgiveness for all the child records I left with my forgotten clients, and moved forward into the First Day of the Rest of My Life. Come to Larry, Tom. Come to Larry and let him HEAL you. -Original Message- Sent: Monday, June 18, 2001 4:45 PM To: Multiple recipients of list ORACLE-L Ross, was the below a typo, or are you making value judgements about my choice of providing for my children? :) Ross p.s. btw, as a former conslutant, one thing i Tom Mercadante Oracle Certified Professional -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? Are ya? Gawd, I wish Eric were here; he'd slap you around with the Barbie you so clearly need. :) (that was the obligatory 'smiley', indicating humor) Ross p.s. btw, as a former conslutant, one thing i learned was, whenever my clients asked anything about oracle on NT, I just laughed cynically, shook my head disconsolately, and said NT? It'll never be scalable. It's really just a buggy piece of poop. p.p.s I just used the word poop because I was with my kids for the entire weekend. Many concepts in a young person's daily flow of events center around poop. It in no way reflects on my Rigidly Authoritarian Employer's view on life. p.p.p.s Even the phrase Rigidly Authoritarian Employer has nothing to do with my employer, workplace, co-workers, or stance on political correctness. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Mercadante, Thomas F INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: Horrifically, Vertiginously OT RE: NT Script
LoL! Every sect needs its special liquid... water, wine, kool-aid, and my own personal favorite: single malt scrotch. -Original Message- [mailto:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 5:46 PM To: Multiple recipients of list ORACLE-L Just sip the purple kool-aid... Scott Shafer San Antonio, TX 210-581-6217 I hate the country, all those animals walking around un-cooked. -Original Message- From: Mohan, Ross [SMTP:[EMAIL PROTECTED]] Sent: Monday, June 18, 2001 4:27 PM To: Multiple recipients of list ORACLE-L Subject: Horrifically, 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. The anonymous calls...all the package bodies, many without hygienic wrappers...My tnslsnr had a port in every storm, and I denied service to no one. Pretty soon I had my own site, and was serving pages to anonymous users for cheap, second relationships. I even inserted records into distributed databases! I felt dirty, 100% used, 0% free, and cheap. After a while, I came to see the SQL*Error of my ways. I became a wage slave. I joined the fold. A group of like-minded people. People will values like my own..I received forgiveness for all the child records I left with my forgotten clients, and moved forward into the First Day of the Rest of My Life. Come to Larry, Tom. Come to Larry and let him HEAL you. -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Mohan, Ross INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: NT script question ???
Yeah, directly from the pharaoh Larry Wall the Magnificent. -Original Message- Sent: Monday, June 04, 2001 10:30 PM To: Multiple recipients of list ORACLE-L 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, 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 book). That version of perl supports Andy Duncan's Orac_DBA and Adam von Nieda's Oracletool (http://www.oracletool.com), two excellent DBA utilities with the unbeatable price. -Original Message- Sent: Saturday, June 02, 2001 7:15 PM To: Multiple recipients of list ORACLE-L Hi, I have couple of questions about bat file in NT 4.0 for Oracle 8.1.5. 1. how to make bat file take parameters. I had a backup.bat, and like to pass in Oracle SID, so the script can backup any database. 2. in the bat file, how to dynamically append date/time into a directory name, like backup_06022001121314 Thank you! Andrea __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Andrea Oracle INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Gogala, Mladen INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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). _ Get your FREE download of MSN Explorer at http://explorer.msn.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rachel Carmichael INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Gogala, Mladen INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: NT script question ???
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 book). That version of perl supports Andy Duncan's Orac_DBA and Adam von Nieda's Oracletool (http://www.oracletool.com), two excellent DBA utilities with the unbeatable price. -Original Message- Sent: Saturday, June 02, 2001 7:15 PM To: Multiple recipients of list ORACLE-L Hi, I have couple of questions about bat file in NT 4.0 for Oracle 8.1.5. 1. how to make bat file take parameters. I had a backup.bat, and like to pass in Oracle SID, so the script can backup any database. 2. in the bat file, how to dynamically append date/time into a directory name, like backup_06022001121314 Thank you! Andrea __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Andrea Oracle INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Gogala, Mladen INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: NT script question ???
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, 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 book). That version of perl supports Andy Duncan's Orac_DBA and Adam von Nieda's Oracletool (http://www.oracletool.com), two excellent DBA utilities with the unbeatable price. -Original Message- Sent: Saturday, June 02, 2001 7:15 PM To: Multiple recipients of list ORACLE-L Hi, I have couple of questions about bat file in NT 4.0 for Oracle 8.1.5. 1. how to make bat file take parameters. I had a backup.bat, and like to pass in Oracle SID, so the script can backup any database. 2. in the bat file, how to dynamically append date/time into a directory name, like backup_06022001121314 Thank you! Andrea __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Andrea Oracle INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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.com -- Author: Gogala, Mladen INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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). _ Get your FREE download of MSN Explorer at http://explorer.msn.com -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Rachel Carmichael INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: NT script question ???
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 C:\batchparam_test.bat one two three four five one two param_test.bat one two three four five C:\batch To append the date / time, use the for command to split up the output of time and date commands. For example: C:\batch test_time.bat [08504789] [0604Mon] --- @echo off rem test_time.bat call :get_timestamp call :get_datestamp goto :EOF ::: :get_timestamp :: get the time in format hhmmssxx, where 'xx' is hundredths of a second :: because want ssxx can not use time/t for /f tokens=1-8 delims=:. %%a in ('echo.^| time ^| find current') do ( set zhh=%%e set zmm=%%f set zss=%%g set zxx=%%h ) if 10 GTR %zhh% set zhh=0%zhh% :: assign the values to ztimefull set ztimefull=%zhh%%zmm%%zss%%zxx% echo [%ztimefull%] rem cleanup set zhh= set zmm= set zss= set zxx= goto :EOF ::: :get_datestamp :: get the time in format mmdd for /f tokens=1-8 delims=:.-/ %%a in ('echo.^| date ^| find current') do ( set z=%%h set zmm=%%g set zdd=%%f ) :: assign the values to zdatefull set zdatefull=%z%%zmm%%zdd% echo [%zdatefull%] rem cleanup set z= set zmm= set zdd= goto :EOF ::: --- A more useful example of parameters might be: @echo off rem PURPOSE remdelete_oldfiles.bat remdeletes files greater than or equal to x days old rem Note - directories are not deleted. rem does not delete read only, hidden or system files rem 18-Apr-2000 , Bruce Reardon : Creation. rem USEAGE rem Parameters - %1 = path , %2 = file mask , rem %3 = how many days old , %4 (optional) - recurse rem ASSUMPTIONS rem none. rem REQUIRES rem forfiles.exe - distributed with NT Resource kit rem that forfiles.exe be located at c:\nt4reskit rem SIDE EFFECTS rem envdelold env variable will be overwritten and deleted if it exists. rem MODIFICATIONS :: rem Parameter validation. IF %3== goto param_problem :: not enough params IF NOT %5== goto param_problem :: too many params rem check parameter 3 is a valid number set envdelold= IF %3==0 goto param3_ok set /a envdelold = 1*%3 2 nul: IF %envdelold%==0 goto param3_problem IF %envdelold%== goto param3_problem :param3_ok IF NOT %4== IF NOT %4==-s goto param4_problem :: invalid param 4 IF NOT EXIST %1. goto param1_problem rem we now have 3 (possibly 4) parameters and they have been validated. echo %1 %2 %3 %4 rem the actual command - put quotes around to allow for names with spaces. c:\nt4reskit\forfiles -p%1 -m%2 %4 -d-%3 -ccmd /c if @ISDIR==FALSE del 0x22@FILE0x22 goto end :param_problem echo %0 echo ERROR - Must pass in 3 parameters (4 max) echo Param 1 is the path echo Param 2 is file mask echo Param 3 is number of days echo Param 4 (optional) : if -s then recurse subdir's. echo. echo eg %0 c:\temp *.* 5 would delete ALL files in c:\temp directory 5 or more days old goto end :param1_problem echo %0 [--[%1]--] %2 %3 %4 echo ERROR - 1st parameter invalid echo Param 1 is the path and it must exist. echo. echo eg %0 c:\temp *.* 5 would delete ALL files echo in c:\temp directory 5 or more days old goto end :param3_problem echo %0 %1 %2 [--[%3]--] %4 echo ERROR - 3rd parameter invalid echo Param 3 is the number of days and it must be a valid number echo. echo eg %0 c:\temp *.* 5 would delete ALL files echo in c:\temp directory 5 or more days old goto end :param4_problem echo %0 %1 %2 %3 [--[%4]--] echo ERROR - 4th parameter invalid echo Param 4 (optional) : must be -s (to recurse subdir's) or be blank. echo. echo eg %0 c:\temp *.* 5 -s would delete ALL files echo in c:\temp directory (incl subdirs) 5 or more days old goto end :end rem - batch file finished set envdelold= --- -Original Message- Sent: Sunday, 3 June 2001 9:15 Hi, I have couple of questions about bat file in NT 4.0 for Oracle 8.1.5. 1. how to make bat file take parameters. I had a backup.bat, and like to pass in Oracle SID, so the script can backup any database. 2. in the bat file, how to dynamically append date/time into a
NT script
Hi, Thank you all very much for answering my NT batch script question. Do you mind I ask another one? I pass in SID as a parameter, if they don't pass it in, I'd like to echo out an error message. So how to check whether the parameter is passed in or not? I never write bat file before. Are there some good ways, web site/book/doc that I can do some research by my own, so I don't have to bug people whenever I got a question. Thank you! Andrea __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Andrea Oracle INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
RE: NT script and NT Script resources
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 Macmillan Technical Publishing ISBN 1-57870-047-7 Resources NT batch specific news:alt.msdos.batch.nt http://groups.google.com/groups?oi=djqas_ugroup=alt.msdos.batch.nt UltraTech knowledge base http://www.ultratech-llc.com/Personal/Files/?File=ResKit.TXT JSI Windows NT/2000 Tips, Tricks, Registry Hacks and more... http://www.jsiinc.com/Reghack.htm#Tip%20Index NT/Win2k scripting - good on bat differences between NT and DOS http://www.seanet.com/~shardy/ntscript.html Resources batch general: Batfiles: The DOS batch file programming handbook and tutorial - good examples and hints / tricks http://home7.inet.tele.dk/batfiles/ DOS Batch Language: A personal view by Ted Davis - good intro for beginners http://131.151.112.77/~batch/batchtoc.htm news:alt.msdos.batch http://groups.google.com/groups?oi=djqas_ugroup=alt.msdos.batch Multilingual Batch Programs http://gearbox.maem.umr.edu/~batch/multilingual.html Programs by Prof. Timo Salmi - THE author of the alt.msdos.batch FAQ http://garbo.uwasa.fi/pc/ts.html and then search for tsbat67.zip 184193 Mar 8 11:16 A collection of useful batch files and tricks, T.Salmi Have fun, Bruce -Original Message- Sent: Monday, 4 June 2001 2:35 Hi, Thank you all very much for answering my NT batch script question. Do you mind I ask another one? I pass in SID as a parameter, if they don't pass it in, I'd like to echo out an error message. So how to check whether the parameter is passed in or not? I never write bat file before. Are there some good ways, web site/book/doc that I can do some research by my own, so I don't have to bug people whenever I got a question. Thank you! Andrea -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Reardon, Bruce (CALBBAY) INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).
NT script question ???
Hi, I have couple of questions about bat file in NT 4.0 for Oracle 8.1.5. 1. how to make bat file take parameters. I had a backup.bat, and like to pass in Oracle SID, so the script can backup any database. 2. in the bat file, how to dynamically append date/time into a directory name, like backup_06022001121314 Thank you! Andrea __ Do You Yahoo!? Get personalized email addresses from Yahoo! Mail - only $35 a year! http://personal.mail.yahoo.com/ -- Please see the official ORACLE-L FAQ: http://www.orafaq.com -- Author: Andrea Oracle INET: [EMAIL PROTECTED] Fat City Network Services-- (858) 538-5051 FAX: (858) 538-5051 San Diego, California-- Public Internet access / Mailing Lists 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).