top of page

Why is my msdb so large?

  • Adam Thurgar
  • Mar 4, 2018
  • 1 min read

msdb is a system database used mainly by the SQL Server Agent to store system activities like SQL Server jobs, mail, service broker, maintenance plans, user and system database backup history, etc.

Like any database it needs to be monitored and maintained. You may find that your msdb database has grown significantly.

What may have caused this could be:

- retention of backup history

- maintenance plan logs

- database mail

- job history

To reclaim control over the space in msdb you need to look at deleting data out of the large tables. By looking at the table sizes you can determine what is causing your issues. Most of the time it is just a matter of running a stored procedure to do this cleanup.

For example:

a) sp_delete_backuphistory

b) sp_maintplan_delete_log

c) sysmail_delete_mailitems_sp

d) sp_purge_jobhistory

Then you could shrink the msdb data and log file to reclaim disk space.


 
 
 

Recent Posts

See All
Cardinality estimator

Recently I was asked by a software vendor to review a particular query that ran in under a second on a SQL Server 2014 installation at a...

 
 
 
Index fragmentation

A law firm client, occasionally has issues with their legal software, that is provided by the global leader in this field. The response...

 
 
 
Deleting large amounts of data

I had a client call me about wanting to delete a large amount of data from their database. They knew what tables they wanted to delete...

 
 
 

Comments


bottom of page