Email when restore process fails

Compresses, encrypts, secures and monitors SQL Server backups.

Moderators: JonathanWatts, Chris Auckland, eddie davis, Colin Millerchip, Brian Harris, james.billings, RBA, petey

Email when restore process fails

Postby db3712 » Mon May 05, 2014 5:21 pm

Hello. We utilize a web-based application that requires us to pull data down locally for reporting purposes. We have a restore process setup hourly. Is there an option to email an individual when the restore process fails? Thanks!
db3712
 
Posts: 1
Joined: Mon May 05, 2014 5:13 pm

Postby petey » Tue May 06, 2014 4:19 am

Use the MAILTO_ONERROR option e.g.

Code: Select all
EXEC master..sqlbackup '-sql "RESTORE DATABASE ... WITH MAILTO_ONERROR = [dba@myco.com]"'

You will need to first set up your email server settings in the GUI. Then run a test, from within the GUI, and from an extended stored procedure e.g.

Code: Select all
EXEC master..sqlbackup '-sql "BACKUP DATABASE model TO DISK = [<AUTO>] WITH MAILTO = [dba@myco.com]"'
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 7
petey
 
Posts: 2233
Joined: Sun Apr 24, 2005 12:34 pm


Return to SQL Backup 7

Who is online

Users browsing this forum: No registered users and 0 guests