Sql-server – Job completes successfully and logs the errors to a text file

ola-hallengrensql server

I am using Ola's scripts for our database backups, I am trying to come up with a way to be notified if any of the database backup fails. Job completes successfully and logs the errors to text file, Can we get a notification\alert that it found errors.

Best Answer

Create a notification for the Job failure. The below email will help you with the steps:

Step 1 : Configure database mail and do a test if thats working fine.

Step 2 : Change Agent properties Under Mail session, select the option to Enable mail profile. Ensure the correct Mail profile is selected.

Step 3 : Create Operator. Under the SQL Server Agent, right-click Operators and select New Operator and configure accordingly.

Step 4 : Under the job properties for the backup, go to Notification tab and select email when the job fails:

enter image description here

Step 4 :

Notification for job failure