The following table describes the interaction between the various components in the data collector architecture.
|
Component
|
Component
|
Description
|
|---|
|
SQL Server Management Studio
|
Data collector API
|
The client communicates with the API to configure the data collector.
|
|
SQL Server Management Studio
|
Management data warehouse
|
The client has Read access to the management data warehouse and can obtain the data that is collected.
|
|
SQL Server Management Studio, console client
|
Data collector API
|
Both clients can configure the data collector programmatically by using the API.
|
|
Data collector API
|
Stored procedures and views
|
The API uses stores procedures, which have Read and Write access to the data collector configuration information and the management data warehouse.
|
|
msdb
- Job definition
|
SQL Server Agent
|
SQL Server Agent can read the job definition. The job definition contains job schedule and job configuration information.
|
|
SQL Server Agent
|
Data collector run-time component
|
SQL Server Agent invokes the data collector in response to the job definition.
|
|
Data collector run-time component
|
msdb
- SSIS packages
|
The data collector loads the SSIS packages and can use SSIS to execute these packages.
|
|
Data collector run-time component
|
msdb
- auditing and history
|
The data collector has Write access to this part of msdb so it can record the events generated during data collection.
|
|
SSIS
|
Management data warehouse
|
The SSIS package has Write access to the management data warehouse so it can upload the data that is collected.
|
|
SSIS
|
Temporary storage
|
During the collection process, SSIS can create, use, and delete any temporary storage that it requires.
|
|
msdb
- Data collection configuration
|
msdb
- Job definition
|
Information in the data collection configuration is mapped to the job definition. For more information, see "Collection Set and Job Mapping" below.
|
A key element of the data collector architecture is the mapping between the collection sets defined in the data collector configuration, and the jobs in the job definition.
A collection set is a group of items that are instances of the collector types, which are defined by using SSIS packages. As an instance in memory, every collection set has a lifetime, which is described in more detail later in this topic. Each collection set is run by the data collector run-time component when it is invoked by a SQL Server job. The following examples illustrate how collection sets map to jobs.
Collection Sets
Example 1
This example collection set, "Base Performance Data," contains separate collection and upload packages to support different schedules for the collection and upload packages.
Collection Set: Name = "Base Performance Data"
Collection Item: Name = "SQL_RE_Active_Requests_History"
Collection package: ARH_Collect.dtsx
Upload package: ARH_Upload.dtsx
Collection Frequency: 1 second
Collection Item: Name = "SQL_RE_Wait_Statistics"
Collection package: WS_Collect.dtsx
Upload Package: WS_Upload.dtsx
Collection Frequency: 15 seconds
Collection Item: Name = "SQL_RE_Performance_Counters"
Collection package: PC_Collect.dtsx
Upload package: PC_Upload.dtsx
Input: Counter – Locks: Current Latch Waits
Collection Frequency: 15 seconds
Collection Item: Name = "WIN_OS_Performance_Counters"
Collection package: OS_PC_Collect.dtsx
Upload package: OS_PC_Upload.dts
Input: Counter – Process: % Processor Time
Collection Frequency: 15 seconds
Upload Schedule: Every 30 minutes
Example 2
This example collection set, "Server Configuration Data," contains a single package that gets Transact-SQLbased snapshots and uploads them to the management data warehouse as they are obtained.
Collection Set: Name = "Server Configuration Data"
Collection Item: Name = "SQL_RE_TSQL"
Collection and upload package: TSQL_Upload.dtsx
Input: Transact-SQL query for database sizes
Collection Frequency: <none>
Collection Item: Name = "SQL_RE_TSQL"
Collection and upload package: TSQL_Upload.dtsx
Input: Transact-SQL query for configuration options
Collection Frequency: <none>
Upload Schedule: Every 24 hours
Jobs
When the collection sets shown in the preceding examples are created, SQL Server Agent jobs are created to perform the data collection. The following rules govern job creation:
-
Data collection by different collection sets are executed as separate jobs.
-
Collection sets that use cached collection mode are scheduled as jobs that start when the SQL Server Agent starts. These jobs run continuously and are controlled by the data collector run-time component.
-
Collection sets that use non-cached collection mode are scheduled as normal SQL Server Agent jobs. These jobs use a SQL Server Agent schedule that matches the schedule defined in the collection set. The actual duration of execution can be customized by the user.
The following examples illustrate jobs that use the preceding rules. These jobs can run the collection set examples provided.
Jobs for Collection Set Example 1
Two jobs are used to handle this collection set: one for the collection and one for the upload.
Job 1,Name: "Base Performance Data Collection"
Category: "Data Collector"
Job Step 1:
Collection Set: Name = "Base Performance Data"
Collection Mode: Collection Only, Continuous Run
Packages run: ARH_Collect, WS_Collect, PC_Collect, OS_PC_Collect
Schedule: At Agent start-up
Job 2,Name: "Base Performance Data Upload"
Category: "Data Collector"
Job Step 1:
Collection Set: Name = "Base Performance Data"
Collection Mode: Upload Only, Single Run
Packages run: ARH_Upload, WS_Upload, PC_Upload, OS_PC_Upload
Schedule: Every 30 minutes, Starting at 12:00 AM PST
Job for Collection Set Example 2
One job is created to handle the collection set.
Job 3,Name = "Server Configuration Data"
Category = "Data Collector"
Job Step 1:
Collection Set, Name = "Server Configuration Data"
Collection Mode: Collection and Upload, Single Run
Packages run: TSQL_Upload, TSQL_Upload
Schedule: Every Day at 12:00 AM PST
Note: |
|---|
|
Each of the above examples specifies the collection mode for the job. This information is used to manage collection and upload processing when the collection set is running.
|
The Data Collector and Collection Sets
Because a data collector and a collection set are the elements of data collection that you interact with, you should understand their valid states and the concept of a collection set lifetime.
Valid States
To turn data collection on and off, you can enable or disable data collection. If you want to make any change that affects collector-wide parameters, such as changes to the management data warehouse connection string, you must first disable data collection.
If you want to make any collection set configuration changes, you must first stop the collection set.
If you disable data collection when collection sets are running, these collections sets enter a paused state until you re-enable data collection. At that point, the collection sets resume execution. Any collection set that was not running when you disabled data collection will remain stopped. You can start any collection set while data collection is disabled. However, the collection set will not start execution until you enable data collection.
Collection Set Lifetime
After a collection set starts, it can undergo several transitions in its lifetime. These possible transitions, and the actions that occur during them, include the following:
-
Construct
-
A collection set object is created in memory.
-
All properties can be freely set and modified.
-
Add collector type
-
A new collection item is added to the collection set.
-
The collection set verifies that all collection items reference the same target root.
-
Remove collector type
-
An existing collection item is removed from the collection set.
-
Create
-
The collection set verifies that it contains at least one collection item.
-
Information about all collection items and their properties, collection frequencies, and all the properties of the collection set is inserted into data collector configuration storage.
-
The initial state of the collection set is set to inactive.
-
The SQL Server Agent job or jobs that will run the collection set are created and linked to the collection set.
-
The initial state of the SQL Server Agent jobs is set to inactive.
-
Start
-
The state of the collection set changes to running.
-
Associated SQL Server Agent jobs are enabled.
-
If a job is flagged to run on Agent startup, the job starts immediately.
-
Stop
-
The state of the collection set changes to stopped.
-
All running jobs for the collection set are stopped and disabled.
-
All the jobs associated with the collection set are set to inactive.
-
Delete
-
All the jobs associated with the collection set are deleted from memory.
-
All the objects (collection items, collection set) in data collector configuration that are associated with the collection set are deleted.