x

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, 2009 at 11:03 AM in Default

Steve Jones - Editor gravatar image

Steve Jones - Editor ♦♦
5.1k 77 79 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, 2009 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, 2009 at 11:19 AM

Mansour Shoari gravatar image

Mansour Shoari
435 13 14 15

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

You can also call the stored procedure sp_purge_jobhistory

more ▼

answered Oct 30, 2009 at 11:49 AM

Kev Riley gravatar image

Kev Riley ♦♦
52.8k 47 49 76

Better still, schedule it to run periodically and keep things clean.
Oct 30, 2009 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.

New code box

There's a new way to format code on the site - the red speech bubble logo will automatically format T-SQL for you. The original code box is still there for XML, etc. More details here.

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

SQL Server Central

Need long-form SQL discussion? SQLserverCentral.com is the place.

Topics:

x88
x86

asked: Oct 30, 2009 at 11:03 AM

Seen: 3607 times

Last Updated: Oct 30, 2009 at 11:03 AM