1.1 Choosing a Monitoring Tool 4
1.2 Windows Monitoring Tools 5
3 How to fix long running queries? 6
3.2 Memory Optimized Table (MOT) 6
Learn / SQL / SQL Server
Performance Monitoring and Tuning Tools - SQL Server | Microsoft Learn
Applies to: SQL Server
Microsoft SQL Server provides a comprehensive set of tools for monitoring events in SQL Server and for tuning the physical database design. The choice of tool depends on the type of monitoring or tuning to be done and the particular events to be monitored.
Following are the SQL Server monitoring and tuning tools:
Tool | Description |
|---|---|
Built-in functions display snapshot statistics about SQL Server activity since the server was started; these statistics are stored in predefined SQL Server counters. For example, @@CPU_BUSY contains the amount of time the CPU has been executing SQL Server code; @@CONNECTIONS contains the number of SQL Server connections or attempted connections; and @@PACKET_ERRORS contains the number of network packets occurring on SQL Server connections. | |
DBCC (Database Console Command) statements enable you to check performance statistics and the logical and physical consistency of a database. | |
Database Engine Tuning Advisor analyzes the performance effects of Transact-SQL statements executed against databases you want to tune. Database Engine Tuning Advisor provides recommendations to add, remove, or modify indexes, indexed views, and partitioning. | |
Database Experimentation Assistant (DEA) is a new A/B testing solution for SQL Server. It will assist in evaluating a targeted version of the SQL Server Database Engine for a given workload. When upgrading from a previous SQL Server versions (Starting with SQL Server 2005 (9.x)) to any newer version of SQL Server, DEA will be able to provide comparative analysis metrics. | |
Error Logs | The Windows application event log provides an overall picture of events occurring on the Windows Server and Windows operating systems as a whole, as well as events in SQL Server, SQL Server Agent, and full-text search. It contains information about events in SQL Server that is not available elsewhere. You can use the information in the error log to troubleshoot SQL Server-related problems. |
Extended Events is a light weight performance monitoring system that uses very few performance resources. Extended Events provides three graphical user interfaces (New Session Wizard, New Session and the XE Profiler) to create, modify, display, and analyze your session data. | |
Execution Related Dynamic Management Views and Functions (Transact-SQL) | Execution related DMVs enable you to check execution related information. |
Displays real-time statistics about query execution steps. Because this data is available while the query is executing, these execution statistics are extremely useful for debugging query performance issues. | |
System Monitor primarily tracks resource usage, such as the number of buffer manager page requests in use, enabling you to monitor server performance and activity using predefined objects and counters or user-defined counters to monitor events. System Monitor (Performance Monitor in Microsoft Windows NT 4.0) collects counts and rates rather than data about the events (for example, memory usage, number of active transactions, number of blocked locks, or CPU activity). You can set thresholds on specific counters to generate alerts that notify operators. | |
The Activity Monitor in SQL Server Management Studio is useful for ad hoc views of current activity and graphically displays information about: | |
The Performance Dashboard in SQL Server Management Studio helps to quickly identify whether there is any current performance bottleneck in SQL Server. | |
The Query Tuning Assistant (QTA) feature will guide users through the recommended workflow to keep performance stability during upgrades to newer SQL Server versions, as documented in the section Keep performance stability during the upgrade to newer SQL Server of Query Store Usage Scenarios. | |
The Query Store feature provides you with insight on query plan choice and performance. It simplifies performance troubleshooting by helping you quickly find performance differences caused by query plan changes. Query Store automatically captures a history of queries, plans, and runtime statistics, and retains these for your review. It separates data by time windows so you can see database usage patterns and understand when query plan changes happened on the server. | |
Transact-SQL stored procedures that create, filter, and define tracing: | |
Microsoft SQL Server Distributed Replay can use multiple computers to replay trace data, simulating a mission-critical workload. | |
SQL Server Profiler tracks engine process events, such as the start of a batch or a transaction, enabling you to monitor server and database activity (for example, deadlocks, fatal errors, or login activity). You can capture SQL Server Profiler data to a SQL Server table or a file for later analysis, and you can also replay the events captured on SQL Server step by step, to see exactly what happened. | |
The following SQL Server system stored procedures provide a powerful alternative for many monitoring tasks: | |
Trace flags display information about a specific activity within the server and are used to diagnose problems or performance issues (for example, deadlock chains). |
Choosing a Monitoring Tool
Event or activity | Extended Events | SQL Server Profiler | Distributed Replay | System Monitor | Activity Monitor | Transact-SQL | Error logs | Performance Dashboard |
Trend analysis | Yes | Yes |
| Yes |
|
|
|
|
Replaying captured events |
| Yes (From a single computer) | Yes (From multiple computers) |
|
|
|
|
|
Ad hoc monitoring | Yes1 | Yes |
|
| Yes | Yes | Yes | Yes |
Generating alerts |
|
|
| Yes |
|
|
|
|
Graphical interface | Yes | Yes |
| Yes | Yes |
| Yes | Yes |
Using within custom application | Yes | Yes2 |
|
|
| Yes |
|
|
Windows Monitoring Tools
Windows operating systems and Windows Server 2003 also provide these monitoring tools.
Tool | Description |
|---|---|
Task Manager | Shows a synopsis of the processes and applications running on the system. |
Network Monitor Agent | Monitors network traffic. |
Tuning
How to fix long running queries?
Partition
Memory Optimized Table (MOT)
Temporal Table
Statistics – sys.states
Index Management
Lock Management
No comments:
Post a Comment