MAILONERROR is not working in restore

essamughalessamughal Posts: 35
edited August 28, 2006 12:18PM in SQL Backup Previous Versions
Hi;

I have an issue with MAILONERROR feature, it is not working in my Restore job, the job was failed due to missing log file but the email was not sent and I did not know the job was not working on production. I tested emails on server, the MAILTO Function is working fine. I am getting emails on SUCCESS, but I need emails when job fails.

Is there any issue with that in newer version of SQL Backup v 4.5, it was running in older version. Is there any limit of email address in this parameter, I am sending to four email addresses.

Thanks

Comments

  • peteypetey Posts: 2,358 New member
    When the first transaction log file to be restored is the wrong one, SQL Server raises an error code (4305), but SQL Backup does not. This has been the behaviour since 4.0. The MAILTO_ONERROR only sends an email when SQL Backup raises an error.

    We will review this functionality to see how we can make it more flexible.

    No, there isn't a limit to the number of email addresses, as long as it is accepted by your email server and the entire SQL Backup command does not exceed 2 KB in length.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • As I mentioned the functionality was working in earlier version and if you see I got the following email from the same job which I created for log restore and now the MAILONERROR feature is not working in the same case when LSN is not correct. I think it might help you finding out the problem with this feature now. The explaination which you gave is making sense but it is not true for the following case since I got emails in July and in June as well.

    ***********************************************

    Subject: ERROR - log restore [abcSTANDBY] on 7/31/2006 4:12:02 PM


    SQL Backup log file
    7/31/2006 4:12:01 PM: Restoring abcSTANDBY (transaction logs) from:
    H:\LogShipping\logshipping\LOG_(local)_ABC_20060731_014500.sqb

    7/31/2006 4:12:01 PM: RESTORE LOG [abcSTANDBY] FROM DISK = 'H:\LogShipping\logshipping\LOG_(local)_ABC_20060731_014500.sqb' WITH STANDBY = 'H:\UNDO_abcSTANDBY.DAT', MAILTO = 'essa@ilogic.com', LOGTO = 'H:\RestorLog.txt', ERASEFILES = 7, FILEOPTIONS = 1, PASSWORD = 'XXXXXXXXXX', MOVETO = 'H:\LogShipping\Processed\'


    7/31/2006 4:12:01 PM: Server: Msg 3013
    RESTORE LOG is terminating abnormally.
    7/31/2006 4:12:01 PM: Server: Msg 4305
    The log in this backup set begins at LSN 33292000001276900001, which is too late to apply to the database. An earlier log backup that includes LSN 32933000001371500001 can be restored.

    ***********************************************

    Please, have a look into that problem, this is one of the feature of Red-Gate tool which convinced us to purchase the tool.

    Thanks
  • peteypetey Posts: 2,358 New member
    From the mail you provided, it appears that you are using the MAILTO option, not the MAILTO_ONERROR option.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • Thanks for letting me that, so I need to have MAILTO always in my statement, since I don't need email in case of SUCCESS and my job is running every 5 to 15 minutes and I'll be getting hunderds of emails in a day. So that, I removed MAILTO and used MAILONERROR parameter so that I can get email only when I get an error.

    Do you have any suggestion and solution for that case ! OR I have to use MAILTO always and delete email if SUCCESS appears in subject?

    Thanks
  • peteypetey Posts: 2,358 New member
    For now, there isn't a way to get around the design. You would have to use the MAILTO option.

    We will look into working something out for this in the next release.
    Peter Yeoh
    SQL Backup Consultant Developer
    Associate, Yohz Software
    Beyond compression - SQL Backup goodies under the hood, updated for version 8
  • Thanks Petey!

    I created a rule for myself now, to delete SUCCESS email and move ERROR emails into a particular folder.


    I hope you all will improve this funcationality since it is making sense to have.

    Thanks
Sign In or Register to comment.