How do I clean my WSUS database?

Intro

In this tutorial, I will explain how to maintain and optimize the installation of your WSUS service to keep it in optimal operating condition.

If your WSUS console shuts down regularly, I advise you to switch the database to SQL Server. For that you have two solutions:

  • Migrate the existing database to SQL Server.
  • Since Windows 2016, it is possible during installation to choose a SQL Server.

Reject replaced Updates

As the months pass, updates accumulate on the WSUS server and some updates are overwritten by others.

Keeping the updates replaced have no interest.

From the list of approved updates 1 , select the updated updates that are identifiable using the pictograms visible in the capture.

How do I clean my WSUS database?

Once the updates are selected, right click on 1 and click on Refuse 2 .

How do I clean my WSUS database?

Confirm the action by clicking Yes 1 .

How do I clean my WSUS database?

Wait during the refusal of the updates …

How do I clean my WSUS database?

Replaced updates are now rejected and no longer shown to computers.

Clean unused files

Cleaning unused files will remove the files physically present on the server.

We will find in these files the replaced updates that were refused.

From the Administration Console, click Options 1 and then click Server Cleanup Wizard 2 .

How do I clean my WSUS database?

At the launch of the wizard, you must choose the items to clean, leave the check box Unwanted update files 1 and click Next 2 .

How do I clean my WSUS database?

Wait while cleaning …

How do I clean my WSUS database?

Once the cleaning is done, click on the button Finish 1 to close the wizard. In the summary appears the freed space.

How do I clean my WSUS database?

Reindexing the database

In order to maintain optimal database performance, it is necessary to reindex the database.

A script is available on the Technet website at this address : Scripts/Maintenance and optimization/WsusDBMaintenance.sql · master · RDR-IT / WSUS · GitLab (rdr-it.io)

Start Microsoft SQL Server Management Studio and connect to the base instance where the WSUS database is running.

How do I clean my WSUS database?

Right-click on SUSDB 1 and click on New Query 2 .

How do I clean my WSUS database?

Paste the script into the query box 1 and click on Run 2 .

How do I clean my WSUS database?

Wait while processing the request …

Once the query is executed, the result is displayed under 1 .

How do I clean my WSUS database?

Reduce the size of the base

Always from SSMS, right click on the database SUSDB 1 then go to Tasks 2 / Reduce 3 and click on Database 4 .

How do I clean my WSUS database?

Click OK 1 to start the database reduction.

How do I clean my WSUS database?

Once optimization is complete, the window closes automatically.

Conclusion

The tips differences in this article will help keep the WSUS services in an operational state.

Can I delete old WSUS content?

It is not recommended to delete the files in the WSUSContent folder. But you can. After deleting you can run wsusutil.exe /reset [ENTER]. WSUS Content.

Where is WSUS database located?

Preparation of migration We can't choose the location of WSUS database during the installation. The default location is C:\Windows\WID\Data. The good news is that we can change this location later.