Use sqlcmd to clean up the WSUS database.

Source: Internet
Author: User

After WSUS runs for a period of time, it accumulates outdated patches or computer information and does not clean up for long periods, which can cause the database to become larger and slower, and the client cannot install patches through WSUS.


WSUS provides a server Cleanup Wizard that can help us clean up WSUS. If you have not cleaned up for a long time, the data is too large, or there are some problems with the database, you may encounter database errors during the cleanup process and cannot clean up your work.

Because WSUS uses internal SQL databse, you can use the SQLCMD tool to clean up if this occurs.


Mainly consists of several parts:


    1. Install SQL Native Client and sqlcmd tools.

    2. Use SQLCMD to execute the index of the SQL database that rebuilt WSUS.

    3. Get the Warp Expiration (Obsolete) ID with sqlcmd.

    4. Delete Expired information

    5. Re-run the Server Cleanup Wizard.



Reference Documentation:

Https://gallery.technet.microsoft.com/scriptcenter/6f8cde49-5c52-4abd-9820-f1d270ddea61#content–script for Database Maintenance


Http://www.microsoft.com/en-us/download/details.aspx?id=30440–download link to install SQLCMD utility


https://technet.microsoft.com/en-us/library/dd939795 (v=ws.10). aspx–using DB Maintenance Script


https://technet.microsoft.com/en-us/library/cc708594 (v=ws.10). Aspx–difference in WSUS 6.2 (Windows 2012)


This article is from the "Forest" blog, please be sure to keep this source http://152957.blog.51cto.com/142957/1698614

Use sqlcmd to clean up the WSUS database.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.