x
login about faq Site discussion (meta-askssc)

How do I clear job history from SQL Agent

My job history appears to be large, how do I clear it? Can I limit it's growth?

more ▼

asked Oct 30 '09 at 11:03 AM in Default

Steve Jones - Editor gravatar image

Steve Jones - Editor ♦♦
5.1k 74 78 82

Its quite important to do this. MSDB lacks indexes in may places and keeping the tables small can help improve performance of tools accessing items such as job history.

Oct 30 '09 at 11:51 AM James Moore
(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Clearing: SQL Server Agent > Jobs > Select the Job > Right mouse click (View History) > Highlight one or more log file summary from the list > Delete

Limiting the growth: SQL Server Agent > Properties > History > Automatically remove agent history older than …

more ▼

answered Oct 30 '09 at 11:19 AM

Mansour Shoari gravatar image

Mansour Shoari
435 10 13 15

(comments are locked)
10|1200 characters needed characters left

You can also call the stored procedure sp_purge_jobhistory

more ▼

answered Oct 30 '09 at 11:49 AM

Kev Riley gravatar image

Kev Riley ♦♦
46.1k 39 43 69

Better still, schedule it to run periodically and keep things clean.

Oct 30 '09 at 02:28 PM Raj More
(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x83
x74

asked: Oct 30 '09 at 11:03 AM

Seen: 2706 times

Last Updated: Oct 30 '09 at 11:03 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.