Quantcast
Channel: NETvNext Blog
Viewing all articles
Browse latest Browse all 63

Re-index WSUS Database Running on WID

$
0
0
Microsoft indicates that performance degradation occurs over time on a Windows Server Update Services (WSUS) database (DB) without proper maintenance and provides a T-SQL script to re-index and defragment a WSUS 3.0 DB here. This post supplements the script instructions to run it when the DB is hosted on a Windows Internal Database (WID), which is used by many System Center Configuration Manager (ConfigMgr) Software Update Point (SUP) implementations.

These are the steps needed to automate running the script using the sqlcmd utility and Windows Task Scheduler when WID is running on Windows Server 2012 R2.

  1. Obtain the SQL command-line tools (includes the sqlcmd utility) by downloading and installing the SQL Server 2012 SP1 Feature Pack on the WID server
  2. Download and install the ODBC Driver 11 for SQL Server on the WID server
  3. Download and save the T-SQL script in a file with the extension .sql (i.e. WsusDBMaintenance.sql)
  4. Create a task in Windows Task Scheduler to run the script
The sqlcmd command-line syntax provided with the script does not work when WID is hosted on Windows Server 2012 R2. Microsoft's instructions indicate:

sqlcmd-S np:\\.\pipe\MSSQL$MICROSOFT##SSEE\sql\query –i <scriptLocation>\WsusDBMaintenance.sql

but when WID is running on Windows Server 2012 R2 it should be:

sqlcmd -I -S np:\\.\pipe\MICROSOFT##WID\tsql\query -i <scriptLocation>\WsusDBMaintenance.sql

Note: The I- parameter to enable QUOTED_IDENTIFIERS should be used regardless of the operating system.

Test the command before you schedule a task:
If you look at the output of the command, the end should look similar to the following:

This is how you would configure the command line and arguments in a Windows scheduled task:


The "Program/script" field basically has the full path to the sqlcmd.exe tool.


SCCM



Viewing all articles
Browse latest Browse all 63

Trending Articles