DetailPage-MSS-KB

Microsoft small business knowledge base

Article ID: 2793580 - Last Review: November 17, 2014 - Revision: 6.0

On This Page

This article describes an update that enables you to exclude system databases from a Query Statistics collection set when you use the management data warehouse in Microsoft SQL Server 2008 R2, Microsoft SQL Server 2008, or in Microsoft SQL Server 2012.

Symptoms

Assume that you use the management data warehouse feature in SQL Server. By default, system databases are included in Query Statistics collection sets. In this situation, you may exhaust the disk space in a high-throughput environment. Specifically, the following two tables that store the query text and plan may grow very large:
  • snapshots.notable_query_text
  • snapshots.notable_query_plan
After you apply this update, the IncludeSystemDatabases setting is available in the following configuration parameter for a Query Statistics data collection item. You can configure IncludeSystemDatabases to decide whether system databases are included.

<ns:QueryActivityCollector xmlns:ns="DataCollectorType">
<Databases IncludeSystemDatabases="True" />
</ns:QueryActivityCollector>
Note By default, the value of IncludeSystemDatabases is set to True.

For example, you can run the following Transact-SQL scripts to exclude system databases:
USE MSDB
GO
 
DECLARE @collection_item_name NVARCHAR(128);
DECLARE @parameters xml;
DECLARE @collection_set_uid uniqueidentifier;
DECLARE @collection_set_id int;
 
DECLARE @collection_item_id int;
 
SET @collection_set_uid = N'2DC02BD6-E230-4C05-8516-4E8C0EF21F95';
 
SET @collection_item_name = 'Query Statistics - Query Activity';
 
SELECT @collection_set_id = collection_set_id
FROM syscollector_collection_sets 
WHERE collection_set_uid = @collection_set_uid;
 
 
SET @collection_item_id = NULL;
SELECT @collection_item_id = collection_item_id
FROM syscollector_collection_items_internal 
WHERE collection_set_id = @collection_set_id 
    AND (name = @collection_item_name OR name = @collection_item_name);
 
 
SELECT @parameters = convert(xml, N'<ns:QueryActivityCollector xmlns:ns="DataCollectorType">
<Databases IncludeSystemDatabases="false" />
</ns:QueryActivityCollector>');
 
 
EXEC dbo.sp_syscollector_update_collection_item 
        @collection_item_id = @collection_item_id, 
        @parameters = @parameters;

Resolution

Cumulative update information

Cumulative Update 13 for SQL Server 2012 SP1  (http://support.microsoft.com/kb/3002044/ )

About cumulative updates for SQL Server

Collapse this imageExpand this image
Each new cumulative update for SQL Server contains all the hotfixes and all the security fixes that were included with the previous cumulative update. Check out the latest cumulative updates for SQL Server:
Collapse this imageExpand this image

Cumulative Update 12 for SQL Server 2008 Service Pack 3

The fix for this issue was first released in Cumulative Update 12. For more information about how to obtain this cumulative update package for SQL Server 2008 Service Pack 3, click the following article number to view the article in the Microsoft Knowledge Base:
2863205   (http://support.microsoft.com/kb/2863205 / ) Cumulative update package 12 for SQL Server 2008 Service Pack 3
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 Service Pack 3 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2629969   (http://support.microsoft.com/kb/2629969 / ) The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 3 was released

Cumulative update 7 for SQL Server 2008 R2 Service Pack 2 (SP2)

The fix for this issue was first released in Cumulative Update 7. For more information about how to obtain this cumulative update package for SQL Server 2008 R2 Service Pack 2, click the following article number to view the article in the Microsoft Knowledge Base:
2844090  (http://support.microsoft.com/kb/2844090/ ) Cumulative update package 7 for SQL Server 2008 R2 Service Pack 2
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 Service Pack 2 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2730301  (http://support.microsoft.com/kb/2730301/ ) The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 Service Pack 2 was released

Cumulative Update 10 for SQL Server 2008 Service Pack 3

The fix for this issue was first released in Cumulative Update 10. For more information about how to obtain this cumulative update package for SQL Server 2008 Service Pack 3, click the following article number to view the article in the Microsoft Knowledge Base:
2814783  (http://support.microsoft.com/kb/2814783/ ) Cumulative update package 10 for SQL Server 2008 Service Pack 3
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 Service Pack 3 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2629969  (http://support.microsoft.com/kb/2629969/ ) The SQL Server 2008 builds that were released after SQL Server 2008 Service Pack 3 was released

Cumulative Update 5 for SQL Server 2008 R2 SP2

The fix for this issue was first released in Cumulative Update 5. For more information about how to obtain this cumulative update package for SQL Server 2008 R2 SP 2, click the following article number to view the article in the Microsoft Knowledge Base:
2797460  (http://support.microsoft.com/kb/2797460/ ) Cumulative update package 5 for SQL Server 2008 R2 Service Pack 2
Note Because the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2008 R2 SP 2 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to view the article in the Microsoft Knowledge Base:
2730301  (http://support.microsoft.com/kb/2730301/ ) The SQL Server 2008 R2 builds that were released after SQL Server 2008 R2 Service Pack 2 was released

Status

Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References

For more information about the management data warehouse, go to the following MSDN website:
General information about the management data warehouse (http://msdn.microsoft.com/en-us/library/bb677306(v=sql.105).aspx)

Applies to
  • Microsoft SQL Server 2012 Service Pack 1, when used with:
    • Microsoft SQL Server 2012 Enterprise
    • Microsoft SQL Server 2012 Developer
    • Microsoft SQL Server 2012 Standard
  • Microsoft SQL Server 2008 R2 Service Pack 2, when used with:
    • Microsoft SQL Server 2008 R2 Datacenter
    • Microsoft SQL Server 2008 R2 Enterprise
  • Microsoft SQL Server 2008 Developer
  • Microsoft SQL Server 2008 Enterprise
  • Microsoft SQL Server 2008 Express
  • Microsoft SQL Server 2008 Standard
  • Microsoft SQL Server 2008 Web
  • Microsoft SQL Server 2008 Workgroup
Keywords: 
kbqfe kbfix kbsurveynew kbexpertiseadvanced KB2793580
Share
Additional support options
Ask The Microsoft Small Business Support Community
Contact Microsoft Small Business Support
Find Microsoft Small Business Support Certified Partner
Find a Microsoft Store For In-Person Small Business Support