Best Practices for SQL Server Agent Job History Retention

What is Best Practices for SQL Server Agent Job History Retention and how to use it? Practical methods and expert examples here.

March 30, 2022
TABLE OF CONTENTS

Best Practices for SQL Server Agent Job History Retention
Category: Reliability
What is SQL Server Agent Job History Retention?

It will determine the amount of SQL Server’s Job History records before deleting them.

Agent job history is set to clear all history records when the history log reaches a certain number of lines by default.

Logs are useful for troubleshooting; having insufficient records makes it difficult to identify problems.

How to identify the problem and how to fix it?

  1. Connect to the SQL instance using SSMS (SQL Server Management Studio);
  2. Right-click on the SQL Server Agent and open properties;

We recommend changing the maximum job history log size (in rows) to 50,000 and the maximum job history rows per job to 1,000.

Note: These numbers may vary depending on your business needs.