Thor Logo dbatools

Diagnostic

Clear-DbaConnectionPool

Chrissy LeMaire (@cl), netnerds.net

Clear-DbaConnectionPool View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Clears all SQL Server connection pools on the specified computer to resolve connection issues. Description Clears all SQL Server connection pools managed by the .NET SqlClient on the target computer. This forces any pooled connections to be discarded and recreated on the next connection attempt. Connection pools can sometimes retain stale or problematic connections that cause intermittent connectivity issues, authentication failures, or performance problems.

Read more

Clear-DbaLatchStatistics

Patrick Flynn (@sqllensman)

Clear-DbaLatchStatistics View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Resets SQL Server latch statistics counters to establish a fresh performance baseline Description Clears all accumulated latch statistics from the sys.dm_os_latch_stats dynamic management view by executing DBCC SQLPERF (N’sys.dm_os_latch_stats’, CLEAR). This resets counters for latch types like BUFFER, ACCESS_METHODS_DATASET_PARENT, and others to zero values. Use this when troubleshooting latch contention to get a clean baseline before running your workload, or during performance testing to measure the impact of specific queries or operations.

Read more

Clear-DbaPlanCache

Tracy Boggiano, databasesuperhero.com

Clear-DbaPlanCache View Source Tracy Boggiano, databasesuperhero.com Windows, Linux, macOS Synopsis Clears SQL Server plan cache when single-use adhoc and prepared plans exceed memory threshold Description Monitors your SQL Server’s plan cache for single-use adhoc and prepared plans that consume excessive memory. When these plans exceed the specified threshold (default 100MB), the function clears the entire plan cache using DBCC FREESYSTEMCACHE(‘SQL Plans’). Single-use plans are a common cause of memory pressure in SQL Server environments with dynamic SQL or applications that don’t use parameterized queries.

Read more

Clear-DbaWaitStatistics

Chrissy LeMaire (@cl)

Clear-DbaWaitStatistics View Source Chrissy LeMaire (@cl) Windows, Linux, macOS Synopsis Resets SQL Server wait statistics to establish a clean monitoring baseline Description Clears all accumulated wait statistics from sys.dm_os_wait_stats by executing DBCC SQLPERF (N’sys.dm_os_wait_stats’, CLEAR). This is essential for performance troubleshooting when you need to establish a new baseline for wait analysis. DBAs commonly clear wait stats after resolving performance issues, during maintenance windows, or when beginning focused monitoring periods to isolate specific workload patterns without historical noise.

Read more

Disable-DbaTraceFlag

Garry Bargsley (@gbargsley), blog.garrybargsley.com

Disable-DbaTraceFlag View Source Garry Bargsley (@gbargsley), blog.garrybargsley.com Windows, Linux, macOS Synopsis Disables globally running trace flags on SQL Server instances Description Turns off trace flags that are currently enabled globally across SQL Server instances using DBCC TRACEOFF. Useful when you need to disable diagnostic trace flags that were enabled for troubleshooting or testing without requiring a restart. Only affects flags currently running in memory - does not modify startup parameters or persistent trace flag settings.

Read more

Enable-DbaTraceFlag

Garry Bargsley (@gbargsley), blog.garrybargsley.com

Enable-DbaTraceFlag View Source Garry Bargsley (@gbargsley), blog.garrybargsley.com Windows, Linux, macOS Synopsis Enables one or more trace flags globally on SQL Server instances Description Activates trace flags at the global level using DBCC TRACEON, affecting all connections and sessions on the target SQL Server instances. Commonly used for troubleshooting performance issues, enabling specific SQL Server behaviors, or applying recommended trace flags for your environment. Changes take effect immediately but are lost after a SQL Server restart - use Set-DbaStartupParameter to make trace flags persistent across restarts.

Read more

Export-DbaExecutionPlan

Chrissy LeMaire (@cl), netnerds.net

Export-DbaExecutionPlan View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Extracts execution plans from plan cache and saves them as .sqlplan files for analysis Description Queries the SQL Server plan cache using dynamic management views and exports execution plans as XML files with .sqlplan extensions. These files can be opened directly in SQL Server Management Studio for detailed analysis and troubleshooting. The function retrieves both single statement plans and batch query plans from sys.

Read more

Get-DbaCpuRingBuffer

Patrick Flynn (@sqllensman)

Get-DbaCpuRingBuffer View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Retrieves historical CPU utilization data from SQL Server’s internal ring buffer for performance analysis Description This command queries sys.dm_os_ring_buffers to extract detailed CPU utilization history for performance troubleshooting and capacity planning. Based on Glen Berry’s diagnostic query, it provides minute-by-minute CPU usage breakdowns that help identify performance patterns and resource contention. The ring buffer stores CPU utilization data in one-minute increments for up to 256 minutes, tracking three key metrics: SQL Server process utilization, other processes utilization, and system idle time.

Read more

Get-DbaCpuUsage

Chrissy LeMaire (@cl), netnerds.net

Get-DbaCpuUsage View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Correlates SQL Server processes with Windows threads to identify which queries are consuming CPU resources Description When CPU usage is high on your SQL Server, it can be difficult to pinpoint which specific SQL queries or processes are responsible using standard SQL Server tools alone. This function bridges that gap by correlating SQL Server process IDs (SPIDs) with Windows kernel process IDs (KPIDs) through system DMVs and Windows performance counters.

Read more

Get-DbaDbVirtualLogFile

Chrissy LeMaire (@cl), netnerds.net

Get-DbaDbVirtualLogFile View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Retrieves detailed virtual log file (VLF) metadata from transaction logs for performance analysis and troubleshooting. Description This function uses DBCC LOGINFO to return detailed metadata about each virtual log file (VLF) within database transaction logs. The output includes VLF size, file offsets, sequence numbers, status, and parity information that’s essential for analyzing transaction log structure and performance. Having a transaction log file with too many virtual log files (VLFs) can hurt database performance.

Read more
← Previous
1 2 3
Next →
Page 1 of 3