If your MSDB database in drive C and it keeps growing, then one of the solutions is to move it into another disk drive, maybe to D or E. MSDB can’t be detach and attach as we do it in user database. I got this problem when I noticed the free space in my drive C is almost 0 while all my database have been kept in drive D. And then I notice the MSDB database keeps growing every day. So I’ve been searched about the way to move it into drive D too. Fortunately, I got the solutions, and it works perfectly well.
What to do is:
1.Open SQL Server Configuration Manager
2.Stop the SQL Server Service and make sure SQL Server Agent is stopped as well
3.Open the properties of SQL Server, in Advance tab, add parameter -c;-m;-T3608 into the parameter values, and then click OK. That's makes SQL to be openned in single user mode.
4.Restart SQL Server Service and Open SQL Server Management Studio without connect to any server. And then click on New Query and run the query:
use master
go
sp_detach_db ‘msdb’
go
5.Move msdbdata.mdf and msdblog.ldf in drive C (usually in C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data) to another drive
6.Delete the added parameter and restart service of SQL Server and SQL Server Agent
7.Attach MSDB database using query:
use master
go
sp_attach_db ‘msdb’,’D:\Database Files\msdbdata.mdf’, ’D:\ Database Files \msdblog.ldf’
go