Sunday, September 18, 2011

Moving your WSUS database

At times the WSUS database can grow large on your server. It is possible to move the database to a larger drive. To accomplish this just perform the following task.

net stop "update services"
net stop w3svc
cd "C:\Program Files\Microsoft SQL Server\MSSQL$WSUS\Binn"
osql -E -S %computername%\wsus -Q "exec sp_detach_db 'SUSDB'"
md d:\WSUSDB
move "C:\Program Files\Microsoft SQL Server\MSSQL$WSUS\Data\SUS*.*" d:\wsusdb
osql -E -S %computername%\wsus -Q "exec sp_attach_db @dbname=N'SUSDB', @filename1=N'D:\WSUSDB\SUSDB.mdf', @filename2=N'D:\WSUSDB\SUSDB_log.ldf'"
net start "update services"
net start w3svc

Thanks

0 comments:

Post a Comment