question

chitrarekhasaha avatar image
chitrarekhasaha asked

Parameter required to send send email after backup job is complete using Ola Hallengren's script

Is there any parameter I have ot add to the following to send email

EXECUTE [dbo].[DatabaseBackup]
@Databases = 'USER_DATABASES',
@Directory = N'D:\Backup\',
@BackupType = 'FULL',
@Verify = 'Y',
@CleanupTime = 48,
@CheckSum = 'Y',
@LogToTable = 'Y'

I have activated the agent to send email, created the operator to send notification, created two alert jobFailed and jobsuccessful.

sql-server-2008-r2
3 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image Kev Riley ♦♦ commented ·

No there's no parameter needed. Have you successfully sent a test email to test that database mail is correctly configured?

1 Like 1 ·
chitrarekhasaha avatar image chitrarekhasaha commented ·

Yes test email is working without any issues. Wonder what else I am missing

0 Likes 0 ·
Kev Riley avatar image Kev Riley ♦♦ commented ·

Are there any clues in msdb.dbo.sysmail_faileditems, or indeed can you see that the email was sent in msdb.dbo.sysmail_sentitems ?

0 Likes 0 ·

1 Answer

·
chitrarekhasaha avatar image
chitrarekhasaha answered

select * from msdb.dbo.sysmail_unsentitems
select * from msdb.dbo.sysmail_faileditems
select * from msdb.dbo.sysmail_sentitems

Executed the following items but did not see any error messages.

Setup the database mail, as well as backupjobs running Ola Hallengren's script:

but do not see an email sent to the specified email address after the job is completed successfully. Backup files are created but do not have a email send when the job is complete.


1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Kev Riley avatar image Kev Riley ♦♦ commented ·

You've setup an alert, but how are you firing that alert?

Why not just put the email notification on the job?

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.