wsus database clean updates

Pantelis Komatas 21 Reputation points
2020-08-20T06:51:26.837+00:00

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
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,109 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rita Hu -MSFT 9,626 Reputation points
    2020-08-24T02:43:38.617+00:00

    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.

    2 people found this answer helpful.
    0 comments No comments

5 additional answers

Sort by: Most helpful
  1. Adam J. Marshall 8,621 Reputation points MVP
    2020-08-24T16:37:20.337+00:00

    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://learn.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/

    1 person found this answer helpful.
    0 comments No comments

  2. Rita Hu -MSFT 9,626 Reputation points
    2020-08-20T10:02:05.25+00:00

    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. Pantelis Komatas 21 Reputation points
    2020-08-21T12:22:54.237+00:00

    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

    0 comments No comments

  4. Pantelis Komatas 21 Reputation points
    2020-08-24T06:53:36.683+00:00

    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