MSSQL: How to setup email notifications for the SQL server backups jobs


How to setup email notifications for the SQL server backup:

1. Open SQL Management console and connect to the database server  using windows credentials.

2. Click on Management and select Database Mail and Right+Click and Select Configure Database Mail.

 

3. Click Next and Select Configuration Task  select Set up Database Mail by performing the following tasks:
  

4. Create a New Profile  Specify the profile name and description.
 

5. Click Add in SMTP accounts. 

6. Give any Account  name and Provide the E-mail Address from which account you want to send the emails.

7. Give any Display name to identify the Job

8. Provide the SMPT Server name and specify the port (Ex: 127.0.0.1 for local loop back address as I am using my SQL server as SMTP server)

9. Click Ok, and Click Next.





















10. Select the profile SQL Job Notification as Public and Select Default Profile as Yes

 

11. Click Next.

12. Select Database Mail Executable Minimum Lifetime (Seconds) and change 600 to 1740 this value has been identified based on so much research and best practices.
 

13. Click Next and Click Finish. 

14. Check for the Success status in configuring page.
 

15. Click Close. 

16. So we have completed with the mail setup with SQL database and we have to enable those notifications.

17. Right+Click on the SQL Server Agent. Select Properties and Select Alert System and select Enable mail profile 

18. Select Mail System as Database Mail and Mail Profile as  SQL Job Notification which we created just in before steps while selecting Mail Profile if you have multiple profile you can see them in the drop box.

19. Click OK. 

20. Now we have to create an Operator (Receipent).

21. Select SQL Server Agent. 

22. Right+Click, New and Select Operator 

23. Profile a Name (Ex: SQL Job Complete)

24. Provide an email in E-mail name (Ex:  notify-bakcup@domain.com)

25. Click OK.



 

























26. Now we have to enable these notifications in the Jobs which we have created.

27. Go to SQL Server Agent and Select Jobs and Select Full_Backup and Right+Click and Properties.

 

28. Select E-mail and Select the SQL Job Complete from  drop down list just we created.
 

29. Click OK. 

30. Select the event you want to when the Job Completes and Click OK 

31. We can do the same for the Incremental and Log Backups Jobs too.

32. Once we had enabled the Notification, Right+Click on SQL Server Agent and Click Restart so that modification which we made will apply to the server.

Keywords: email notification, SQL email notifications, MSSQL Backup notifications 

Comments

Popular posts from this blog

Observium: Configuring Microsoft Windows 2008 Server SNMP Agent

AWS: Upgrade PV Drivers on Windows Instances

How to configure Incremental backups for MSSQL Database