Clear out MSDB file in sql server

I just joined a project which is live for the last 4 - 5 years.
This project is using SQL SERVER 2012 and on the server it has around 1500 databases.

I am noticing that SQL Server is consuming all the assigned memory (which is around 40GB).
Many time Transactions or query are getting timeout by SQL Server these days.

I checked and found that msdb file has grown to 68 GB in size. I am not sure that this is causing all these slow ness.

I tried to run the maintenance plan to clear out msdb but it just did not get ended. I tried it to run for two full days but then also it did not finished.

What I need to know is how can I clear this MSDB and is it one of the reason of this memory consumption by SQL Server
yadavdepAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Vitor MontalvãoMSSQL Senior EngineerCommented:
This project is using SQL SERVER 2012 and on the server it has around 1500 databases.
In a single SQL Server instance? What's the average database size and how large is the biggest one?

I am noticing that SQL Server is consuming all the assigned memory (which is around 40GB).
That's the expected behavior even a minimum of 8GB should be reserved for the operating system.

Many time Transactions or query are getting timeout by SQL Server these days.
You might need to add more memory or a better solution is to build a 2nd SQL Server box and migrate some of the databases there.

I checked and found that msdb file has grown to 68 GB in size. I am not sure that this is causing all these slow ness.
Is not. How much of those 68GB is data and how much is transaction log?

I tried to run the maintenance plan to clear out msdb but it just did not get ended.
Which maintenance plan are you running? What you should do is to configure the SQL Agent to keep a shorter period of jobs history since having 1500 databases it should produce a lot of lines for each maintenance task, for sure. And not counting with each database specific job from their respective applications.
0
lcohanDatabase AnalystCommented:
You should have regular SQL Jobs to cleanup history from msd as described here: "MSDB – CLEANUP IS NECESSARY" https://www.pythian.com/blog/msdb-cleanup-is-necessary/

and you can read a lot of good reasons why here:  https://www.brentozar.com/blitz/msdb-history-not-purged/
"How to Clean Up Overloaded MSDB Backup History"

If the maintenance Cleanup plans never complete you can use T-SQL to purge the history as described here:

https://www.mssqltips.com/sqlservertip/1727/purging-msdb-backup-and-restore-history-from-sql-server/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
SQL

From novice to tech pro — start learning today.