Você está na página 1de 1

SQLShack Español 

SQL Server performance monitoring with Data Collector Newsletter


February 19, 2014 by Milena Petrovic
Enter your email

What is SQL Server Data Collector


Subscribe

SQL Server Data Collector is a feature for performance monitoring and tuning available in SQL Server
Management Studio. It was introduced in SQL Server 2008 and is available in the Enterprise, Standard, Business
Intelligence, and Web editions

What information can it gather?

Data Collector can gather performance information from multiple SQL Server instances and store it in a single
repository. It has three built-in data collecting specifications (data collectors) designed to collect the most
important performance metrics. The information collected by default is about disk usage, query statistics, and
server activity. You can also create additional data collectors and monitor more metrics

How does Data Collector work?


Popular
Data Collector can run constantly, or on a pre-defined schedule
How to copy tables from one database to another in
SQL Server
“The data collector also uses a data warehouse, a relational database that enables you to manage the data that Multiple options to transposing rows into columns
you collect by setting different retention periods for your data.” [1]
How to connect to a remote SQL Server

Database table partitioning in SQL Server


It is recommended for the Management Data Warehouse (MDW) database to be stored in a non-production SQL
A beginner’s guide to SQL Server transaction logs
Server instance. The best solution is to use a SQL Server instance designated only for the MDW, as the feature
doesn’t have an option to exclude a specific database from data collecting. Keep in mind that the MDW can A DBA guide to SQL Server performance
troubleshooting – Problems and performance
grow fast and make sure you have enough free disk space available. The MDW growth rate depends on the metrics
number of transactions, and for high-transaction databases, this can be a couple of hundred MBs a day
Troubleshooting the CXPACKET wait type in SQL
Server
One DMW database can be used as a central database repository for all monitored SQL Server instances SQL Server query execution plans – Understanding
and reading the plans

The data it captures is not only displayed in real-time graphs, like with Activity Monitor, but also saved for later SQL Server 2014 – Install a clustered instance – step-
by-step (1/3)
analysis
How to create and configure a linked server in SQL
Server Management Studio
Besides Data Warehousing, Data Collector uses SQL Server Agent and Integration Services
Using SSIS packages to import MS Excel data into a
database
Once Data Collector is enabled, it creates a number of scheduled jobs necessary for automatic data collection
How to install Microsoft SQL Server Express LocalDB
and data upload into the MDW database. They are also used to purge stored. The feature also adds tables to the
SQL Server query execution plans – Viewing the
msdb database, to store the configuration, auditing and collection history information, job information and SSIS
plans
packages
Connecting PowerShell to SQL Server

Querying remote data sources in SQL Server


Integration Services packages transform and load the collected data into the MDW database
SQL Server cursor tutorial

“Collection sets are defined and deployed on a server instance and can be run independently of each other. Each How to migrate the logins of a database to a
different server
collection set can be applied to a target that matches the target types of all the collector types that are part of a
Creating and using CRUD stored procedures
collection set. The collection set is run by a SQL Server Agent job or jobs, and data is uploaded to the management
data warehouse on a predefined schedule.” [1] 10 most important SQL Server transaction log myths

Reading the SQL Server Transaction Log

Predefined data collection sets


Solutions
The Disk Usage data collection set collects information about disk space used by both data and log files for all
Read a SQL Server transaction log
databases on the SQL Server instance, growth trends, and average day growth
SQL Server database auditing techniques

How to recover SQL Server data from accidental


UPDATE and DELETE operations

How to quickly search for SQL database data and


By default, the Disk Usage data collection set collects data every 60 seconds and uploads data into the MDW objects
database every 6 hours in non-cached mode
Synchronize SQL Server databases in different
remote sources
“In non-cached mode, collection and upload are on the same schedule. The packages start, collect, and upload data Recover SQL data from a dropped table without
at their configured frequency, and run until they are finished. There is only one job created for collection sets in backups

non-cached mode. Non-cached mode allows for the collection and uploading of data to occur on demand, as well How to restore specific table(s) from a SQL Server
as at the intervals specified in the job.” [2] database backup

Recover deleted SQL data from transaction logs

The Query Statistics data collection set collects information about query statistics, activity, execution plans and How to recover SQL Server data from accidental
updates without backups
text on the SQL Server instance. It does not store all executed statements, only 10 worst performing ones
Automatically compare and synchronize SQL Server
data

Open LDF file and view LDF file content

To collect more than top 10 worst performing queries, disable the default Query Statistics Collection Set and Quickly convert SQL code to language-specific client
code
create a custom one using T-SQL or its API
How to recover a single table from a SQL Server
database backup
The Query Statistics data collection set uploads the collected data in the cached mode
Recover data lost due to a TRUNCATE operation
without backups
“In cached mode, the data collection and uploading of jobs are on different schedules, so two jobs are created for How to recover SQL Server data from accidental
each collection set. Cached mode supports continuous collection of data, but less frequent uploads. For example, DELETE, TRUNCATE and DROP operations
the default Server Activity collection set uploads data by default every 15 minutes. However, the collection items are Reverting your SQL Server database back to a
collected every 60 seconds.” [2] specific point in time

How to create SSIS package documentation


In the cached more, one SQL Server job is executed every 60 seconds to collect the data. This data is stored Migrate a SQL Server database to a newer version of
(cached) into a local cache folder. Another job is run every 15 minutes to read the cached data and insert it into SQL Server

the MDW database How to restore a SQL Server database backup to an


older version of SQL Server

The cashed mode creates less overhead than non-cached

The Server Activity collection set collects information about resource usage (CPU, memory, disk I/O, and
network), SQL Server waits, instance activity (batch requests, logouts, SQL compilations and recompilations,
transactions, user connections, and logins), and operating system activity. Data is collected every 60 seconds and
uploaded in cached mode every 15 minutes

The Data Collector feature is pre-defined to collect the data necessary to identify and troubleshoot most
common SQL Server performance problems. It can be set up easily, without coding. If you want to collect more
than the pre-defined metrics, you can create custom collection sets, but coding is required. The feature provides
comprehensive built-in reports for the default collection sets. In the next part of this series, we will give steps to Categories
set up the necessary pre-requests and start data collecting
Auditing (16)

Backup and restore (27)


See more
► Business Intelligence (147)

To get 3 free licenses to a SQL Server monitoring tool, please download ApexSQL Monitor and fill out this simple Cursors (5)
survey Database design (62)

► Database development (175)


References Lists (3)

Maintenance (55)
[1] MSDN – Data Collection
▼ Performance tuning (232)
[2] MSDN -SQL Server 2008 Management Data Warehouse
Alerting (3)

Availability Group (AG) (11)


Useful resources
Buffer Pool Extension (BPE) (5)

Common Table Expressions (CTE) (3)


MSDN – Monitoring SQL Server Performance
MSDN – Manage Data Collection Deadlocks (9)

TechNet Webcast: SQL Server 2008: New Performance Monitoring and Troubleshooting Using Management In-Memory OLTP (13)

Studio Indexes (33)

Latches (2)

Locking (1)

Monitoring (17)

Performance (39)

Performance counters (15)

Milena Petrovic Query analysis (52)


Milena is a SQL Server professional with more than 20 years of experience in IT. She has started Reports (6)
with computer programming in high school and continued at University.
Skewed data (1)

She has been working with SQL Server since 2005 and has experience with SQL 2000 through SQL Spinlocks (1)
2014.
SSAS monitoring (2)

Her favorite SQL Server topics are SQL Server disaster recovery, auditing, and performance SSIS monitoring (2)
monitoring. SSRS monitoring (3)

Views (3)
View all posts by Milena "Millie" Petrovic
Wait types (7)

Professional development (8)

Recovery (31)
Related Posts:
Security (39)
1. SQL Server performance monitoring with Data Collector – Part 2 – set-up and usage
SQL Azure (68)
2. SQL Server performance monitoring with Data Collector – Part 3 – reading the reports
SQL Commands (19)
3. A DBA guide to SQL Server performance troubleshooting – Part 2 – Monitoring utilities
4. SQL Server performance tuning using Windows Performance Monitor SQL Server 2012 (2)

5. SQL Server Management Studio performance reports SQL Server 2016 (68)

SQL Server 2017 (25)


Monitoring SQL Server Management Studio (SSMS) (40)

SQL Server on Linux (5)

24,711 Views SQL Server partitioning (8)

Training (9)

Transaction Log (15)

 Helpers and best practices


BI performance counters

SQL Server wait types

© 2018 · ApexSQL · All Rights Reserved

Você também pode gostar