配置数据收集参数 (Transact-SQL)

适用于:SQL Server

在创建自定义收集组之前,必须首先配置数据收集参数。 使用随数据收集器一起提供的存储过程可实现这一操作。 要完成此任务,需使用 SQL Server Management Studio 中的查询编辑器执行以下过程。

注意

数据收集参数只需配置一次。 完成配置后, 这些参数将用于您所创建的其他所有收集组。

配置数据收集参数

  1. 在 SQL Server Management Studio 中,连接到要在其中创建自定义收集组的数据库。

  2. 在查询编辑器中发出以下语句:

    USE msdb;
    GO
    
    EXEC sp_syscollector_set_warehouse_instance_name N'INSTANCE_NAME';-- where instance name is the name of the SQL Server instance
    EXEC sp_syscollector_set_warehouse_database_name N'MDW';
    EXEC sp_syscollector_set_cache_directory N'D:\tempdata';