Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Hi all,
I am working with Oracle db backup and what I am trying to accomplish is to find an error message string in the temp. log file (cold_backup.txt) that the backup routine creates. In either case whether it finds it or not, I would like to send email (using blat util.) with notification in the subject line. Here is the part of the code that I am struggling with. Even when the there isn't any errors. I still get an email with subject that backup did not complete successfully:
set ALERT_LOG=E:\oracle\admin\remprod\bdump\ALERT_REMPROD.LOG
set ERRFILE=E:\oracle\admin\remprod\bdump\ALERT_ERRORS.TXT
set SUBJECT1=Database Backup Completed Successfully
set SUBJECT2=Database Backup did not Complete Successfully
set TEMP_ALERT_FILE=REMPRODALRT.LOG.TEMP
set TEMP_ALERT_LOG=E:\oracle\oradata\remprod\archives\cold_backup\cold_backup.txtdel /q E:\oracle\admin\remprod\bdump\ALERT_ERRORS.TXT
@echo off
if exist %TEMP_ALERT_LOG% findstr /n "corrupt Corrupt CORRUPT ORA- OSD- O/S-" %TEMP_ALERT_LOG% > %ERRFILE%
@echo on
blat %ERRFILE% -s "%SUBJECT2%" -t %EMAIL_ADDRESS_1%if %ERRORLEVEL% = 1
blat %ERRFILE% -s "%SUBJECT1%" -t %EMAIL_ADDRESS_1%VN

Viktor,
You might be better off posting in the programming forum.
I would use VB for this, so I am not really familiar with the syntax, but as one programmer to another, have you checked that this line does find the error text?
if exist %TEMP_ALERT_LOG% findstr /n "corrupt Corrupt CORRUPT ORA- OSD- O/S-" %TEMP_ALERT_LOG% > %ERRFILE%
If so, could the failure with the subject line be due to a timing issue? I would try with a PAUSE in the line after del /q....
Peter
(Alert me if you want a reply)

![]() |
Windows Media Player Play...
|
remote command in W2K
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |