WSUS cleanup aborts

Mathias 56 Reputation points
2021-01-18T13:51:53.79+00:00

Hi there,

I have a WSUS server with version 10.0.14393.2969. If I start the cleanup there and select "Unused updates and update revisions", the cleanup stops after 3 minutes with the error that the database is very busy. The same behavior also occurs when executing the cleaning script. I have already set the timeout in SQL to 0, but unfortunately no improvement. A SQL Server 2016 runs as the database on the system. The database is already 20 GB in size, which I think is quite large. About 7000 clients report to the WSUS. Does anyone have any idea what I can do to make the WSUS clean up again?

Windows Server
Windows Server
A family of Microsoft server operating systems that support enterprise-level management, data storage, applications, and communications.
12,288 questions
0 comments No comments
{count} votes

Accepted answer
  1. Rita Hu -MSFT 9,626 Reputation points
    2021-01-19T02:19:44.013+00:00

    Hi 38542140,

    Thanks for your posting on this forum.

    Please refer to the below steps to see whether this issue will be resolved or not:

    Method 1.Open the SSMS as an administrator and connect to the WSUS database.
    Right click on the server name, select Properties/Connections, set timeout from remote query timeout from 600 to 0 (= no timeout). Then run the server cleanup wizard again and wait for the results. It would take lots of time to complete.
    Reference picture:
    57814-1.png

    Method 2.We could run the following query in the SSMS to delete the unused updates and update revisions directly.

    DECLARE @var1 INT  
    DECLARE @msg nvarchar(100)  
      
    CREATE TABLE #results (Col1 INT)  
    INSERT INTO #results(Col1) EXEC spGetObsoleteUpdatesToCleanup  
      
    DECLARE WC Cursor  
    FOR  
    SELECT Col1 FROM #results  
      
    OPEN WC  
    FETCH NEXT FROM WC  
    INTO @var1  
    WHILE (@@FETCH_STATUS > -1)  
    BEGIN SET @msg = 'Deleting' + CONVERT(varchar(10), @var1)  
    RAISERROR(@msg,0,1) WITH NOWAIT EXEC spDeleteUpdate @localUpdateID=@var1  
    FETCH NEXT FROM WC INTO @var1 END  
      
    CLOSE WC  
    DEALLOCATE WC  
      
    DROP TABLE #results  
    

    Hope the above will be helpful.

    Please remember to inform me if there are any updates.

    Regards,
    Rita


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    1 person found this answer helpful.
    0 comments No comments

9 additional answers

Sort by: Most helpful
  1. Adam J. Marshall 8,886 Reputation points MVP
    2021-01-18T15:19:13.897+00:00

    Are you performing the proper WSUS maintenance including but not limited to running the Server Cleanup Wizard (SCW), declining superseded updates, running the SQL Indexing script, etc.?

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

    It's not just running the SCW that's needed (and yes, timeouts can occur if the other parts of maintenance is not done).

    1 person found this answer helpful.
    0 comments No comments

  2. Mathias 56 Reputation points
    2021-01-18T17:47:54.197+00:00

    Hi, thanks for your reply. I have already declined and removed all replacing updates. Then I ran the Windows cleanup script. Unfortunately it breaks off every time it is cleaned up. Then I also ran the SQL Reindex script but after that there was no improvement. Do you have another idea for me? If your tool would help me, then I would buy this.

    1 person found this answer helpful.

  3. Mathias 56 Reputation points
    2021-01-19T07:53:01.043+00:00

    Hi there,

    I've already heard the timeout set to 0, unfortunately no improvement. I have already removed manual deletion, but nothing is dealt with. What else can I do now, do the WSUS again or is there another solution?

    57960-wsus-bild-1.jpg

    1 person found this answer helpful.

  4. Mathias 56 Reputation points
    2021-01-19T08:55:59.71+00:00

    Hi,

    I had set the value a long time ago, but it didn't bring anything either.

    57820-privater-speicher.jpg

    1 person found this answer helpful.
    0 comments No comments