Thor Logo dbatools

DBCC

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

Get-DbaDbccHelp

Patrick Flynn (@sqllensman)

Get-DbaDbccHelp View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Retrieves syntax help and parameter information for DBCC commands Description Executes DBCC HELP against SQL Server to display syntax, parameters, and usage information for Database Console Commands. This saves you from having to look up DBCC command syntax in documentation, especially for complex commands like CHECKDB, CHECKTABLE, or SHRINKFILE. Supports both documented and undocumented DBCC commands when used with the IncludeUndocumented parameter.

Read more

Get-DbaDbccMemoryStatus

Patrick Flynn (@sqllensman)

Get-DbaDbccMemoryStatus View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Executes DBCC MEMORYSTATUS and returns memory usage details in a structured format Description Runs DBCC MEMORYSTATUS against SQL Server instances and parses the output into a structured PowerShell object for analysis. This replaces the need to manually execute DBCC MEMORYSTATUS and interpret its raw text output, making memory troubleshooting and monitoring much easier. The function organizes memory statistics by type (like Memory Manager, Buffer Manager, Resource Pool, etc.

Read more

Get-DbaDbccProcCache

Patrick Flynn (@sqllensman)

Get-DbaDbccProcCache View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Retrieves plan cache memory usage statistics from SQL Server instances Description Executes DBCC PROCCACHE against SQL Server instances and returns structured information about plan cache memory utilization. This command reveals how much memory is allocated for storing compiled execution plans, how much is currently being used, and how many plan entries are active. Essential for diagnosing memory pressure issues, understanding plan cache efficiency, and monitoring whether the plan cache is consuming excessive memory or experiencing frequent evictions that could impact query performance.

Read more

Get-DbaDbccSessionBuffer

Patrick Flynn (@sqllensman)

Get-DbaDbccSessionBuffer View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Retrieves session input or output buffer contents using DBCC INPUTBUFFER or DBCC OUTPUTBUFFER Description Executes DBCC INPUTBUFFER or DBCC OUTPUTBUFFER to examine what SQL statements a session is executing or what data is being returned to a client. InputBuffer shows the last SQL batch sent by a client session, which is essential for troubleshooting blocking, investigating suspicious activity, or understanding what commands are causing performance issues.

Read more

Get-DbaDbccStatistic

Patrick Flynn (@sqllensman)

Get-DbaDbccStatistic View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Retrieves statistics information from tables and indexed views for query performance analysis Description Executes DBCC SHOW_STATISTICS to extract detailed information about statistics objects, including distribution histograms, density vectors, and header information. This helps DBAs diagnose query performance issues when the optimizer makes poor execution plan choices due to outdated or skewed statistics. You can analyze specific statistics objects or scan all statistics across databases to identify when UPDATE STATISTICS should be run.

Read more

Get-DbaDbccUserOption

Patrick Flynn (@sqllensman)

Get-DbaDbccUserOption View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Retrieves current session-level SET options and connection settings from SQL Server instances Description Executes DBCC USEROPTIONS against SQL Server instances to display current session settings including ANSI options, isolation levels, date formats, language, and timeout values. This is particularly useful when troubleshooting application connection issues or verifying that session-level defaults match across environments. You can filter results to specific options or retrieve all current settings to compare against expected configurations during deployments or performance investigations.

Read more

Get-DbaDbDbccOpenTran

Patrick Flynn (@sqllensman)

Get-DbaDbDbccOpenTran View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Identifies the oldest active transactions in database transaction logs using DBCC OPENTRAN Description Executes DBCC OPENTRAN against specified databases to identify long-running or problematic transactions that may be causing blocking, transaction log growth, or replication delays. This function helps DBAs troubleshoot performance issues by revealing the oldest active transaction and any distributed or replicated transactions within each database’s transaction log.

Read more

Get-DbaDbIdentity

Patrick Flynn (@sqllensman)

Get-DbaDbIdentity View Source Patrick Flynn (@sqllensman) Windows, Linux, macOS Synopsis Retrieves current identity values from tables without reseeding using DBCC CHECKIDENT Description Executes DBCC CHECKIDENT with the NORESEED option to retrieve current identity seed and column values from specified tables without modifying anything. This provides a safe way to inspect identity column status across multiple tables, databases, and instances simultaneously. DBAs use this when troubleshooting identity gaps, planning bulk operations, or auditing identity column usage before performing maintenance tasks.

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