none
WSUS Cleanup - can this be done is phases?

    質問

  • We've recently noticed performance issues with our SCCM clients when downloading Endpoint updates so we've been advised my Premier Support to run a WSUS cleanup.  The problem I have is that we have never run a clean up before and when I tried it in test it took hours and hours to complete (it crashed via the GUI so I have been given a SQL script).

    The performance should definitely be better on our production boxes however I'm unable to obtain a maintance window long enough to complete the work.  I need to run it on our two Primarys and CAS.  Is there any way of staging the clean up so that I can do small amounts gradually over a few weeks, rather attempting to do all three servers over a weekend?

    I'd be grateful if anyone could let me know.

    Thanks 

    2015年6月24日 10:17

回答

  • Sorry only just saw you message so maybe too late for you, but might help someone else.  I ran the script I copied above on the two site servers then the CAS.  It took about 7 hours per server so I managed to complete in a weekend.  Unfortunately it didn't resolve the initial problem with Endpoint performance.  That was fixed by deploying patch KB3075851.
    • 回答としてマーク LinJack 2015年10月29日 11:38
    2015年10月29日 11:17

すべての返信

  • You can perform a cleanup only on a per-database basis, but not gradually for each database. Such a script should run for a couple of minutes only (up to some hours  maybe).

    Torsten Meringer | http://www.mssccmfaq.de

    2015年6月24日 10:23
  • OK Thanks Torsten.  It's picked up something like 6000 obsolete objects in the test environment and has taken over 24 hours to delete them.  I know this is test, but even so.  I do not have anywhere near that amount of time to complete this work before I'm unable to touch the server because it's being used for other deployments.  It's a shame that you can't delete in sections, even if it had to be done manually.

    • 編集済み LinJack 2015年6月24日 11:11
    2015年6月24日 10:30
  • I've never seen it taking so long. What SQL command are you using to clean up the database? I guess that it's using a cursor to delete items one by one. That can be modified to clean up smaller batches then. 

    Torsten Meringer | http://www.mssccmfaq.de

    2015年6月24日 11:46
  • This is the query

    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

    2015年6月24日 11:58
  • Yes, I know this is an old post, but I’m trying to clean them up. Did you solve this problem, if so what was the solution?

    That SQL looks similar to Kent's blog post.

    http://blog.coretech.dk/kea/house-of-cardsthe-configmgr-software-update-point-and-wsus/

    I find that the SQL script that Kent's post can take hours/days to complete and you might need to run it multiple times to clean up all the data.


    Garth Jones | My blogs: Enhansoft and Old Blog site | Twitter: @GarthMJ

    2015年8月22日 15:01
    モデレータ
  • Sorry only just saw you message so maybe too late for you, but might help someone else.  I ran the script I copied above on the two site servers then the CAS.  It took about 7 hours per server so I managed to complete in a weekend.  Unfortunately it didn't resolve the initial problem with Endpoint performance.  That was fixed by deploying patch KB3075851.
    • 回答としてマーク LinJack 2015年10月29日 11:38
    2015年10月29日 11:17