question

PantelisKomatas-3653 avatar image
0 Votes"
PantelisKomatas-3653 asked RogerCornelius-2930 published

wsus database clean updates

Dear all we have sccm 2012 and we use it with wsus to deploy updates.We have never cleared the unused updates for years and wsus sync stoped working.The server clean up wizard also fail to run and i found sql query to clear it. So when i run EXEC spGetObsoleteUpdatesToCleanup it found more than 20.000 updates to clear and for some reason when i run EXEC spDeleteUpdate @localUpdateID= it needs more than 3 minutes to delete 1 update. Is there anyway i can run it faster because i can wait so many days for this to finish?

Regards
Pantelis Komatas

windows-server-update-services
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RitaHu-MSFT avatar image
0 Votes"
RitaHu-MSFT answered RitaHu-MSFT rolled back

Hi Pantos,


What is the structure of your WSUS? If your current environment has only one WSUS, it is recommended to uninstall the current WSUS and reinstall it. In my opinion, uninstalling and reinstalling the WSUS role will solve the current problem more quickly.


To remove WSUS completely, you need to:
1.

Remove the following server roles and features through Server Manager:
Roles: Windows Server Update Server
features: Windows Server Update Services Tools(at Remote Server Administration Tools -> Role Administration Tools)
Follow the wizard prompts to complete the deletion. Then restart the server.

2.

After the server is restarted, manually delete the folder or file of the following path:
C:\WSUS (this depends on where you choose to install WSUS)
C:\Program Files\Update Services


3.
Delete database files
If you use SQL Server Management Studio to delete a database, you can try as follow.
In Object Explorer, connect to an instance of the SQL Server Database Engine, and then expand that instance. Expand Databases, right-click the database to delete, and then click Delete. Confirm the correct database is selected, and then click OK.

If you use a WID database, it is recommended to delete the following path folders:
C:\Windows\WID

4.

In the IIS Information Services (IIS) Manager, manually remove the WSUS Administration site. Then restart the server.



If the response is helpful, please click "Accept Answer" and upvote it.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

RitaHu-MSFT avatar image
0 Votes"
RitaHu-MSFT answered RogerCornelius-2930 published

Hi PantelisKomatas-3653,


Thanks for your posting on Q&A.


It is recommended to run the script to reindex the database first. Here is the following picture about how to use this script for your reference:


19097-3.png

Then we may try to clean up the database.

If there are any feedbacks, please inform me.


Please remember to MARK the answer if it is helpful.


Regards,
Rita




3.png (75.8 KiB)
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

The link to "the script" appears to be broken.

0 Votes 0 ·
PantelisKomatas-3653 avatar image
0 Votes"
PantelisKomatas-3653 answered

Hi Rita,

Thank you for your answer. I have already run the reindexing but it doesnot help. Anyway after about 100 updates was deleted the wsus sync start to work again. So now i delete about 1000 updates each day and after 20 days will be clean. I read in another forums also that other guys have same problem for others also took more than 15 days to finish

Regards
Pantos

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PantelisKomatas-3653 avatar image
0 Votes"
PantelisKomatas-3653 answered RitaHu-MSFT commented

Hi Rita,

I have one SCCM server and in same server also is the wsus role installed, all are controlled through SCCM. If i do what you suggest, is this going to impact my SCCM?

Reagrds
Pantos

· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Pantos,


No. WSUS is a role that is integrated into SUP. Following the above actions is OK. Don't forget to rebuild the WSUS role after uninstalling it.


Regards,
Rita

0 Votes 0 ·
AJTek-Adam-J-Marshall avatar image
1 Vote"
AJTek-Adam-J-Marshall answered

Although WAM wouldn't help make it faster, it offers the ability for you to not have to babysit it. You would be able to let it run in the background and it would work and work until it's done. If you wanted to get it done faster, then yes, you'll have to re-install WSUS - https://www.ajtek.ca/wsus/how-to-remove-wsus-completely-and-reinstall-it/

https://docs.microsoft.com/en-us/mem/configmgr/sum/get-started/install-a-software-update-point

After you reinstall, make sure you do all the required maintenance of WSUS so this doesn't come back again to haunt you.

https://www.ajtek.ca/wsus/how-to-setup-manage-and-maintain-wsus-part-8-wsus-server-maintenance/

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

PantelisKomatas-3653 avatar image
0 Votes"
PantelisKomatas-3653 answered

Hi,

Thank you both for your answers.....i have decided to delete them slowly since i have no issues at the moment.

Regards
Pantos

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.