Author | Claudio Silva (@claudioessilva) |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Test-DbaMaxDop on GitHub.
Want to see the Bill Of Health for this command? Check out Test-DbaMaxDop.
Displays information relating to SQL Server Max Degree of Parallelism setting. Works on SQL Server 2005-2016.
Inspired by Sakthivel Chidambaram's post about SQL Server MAXDOP Calculator (https://blogs.msdn.microsoft.com/sqlsakthi/p/maxdop-calculator/),
this script displays a SQL Server's: max dop configured, and the calculated recommendation.
For SQL Server 2016 shows:
More info:
https://support.microsoft.com/en-us/kb/2806535
https://blogs.msdn.microsoft.com/sqlsakthi/2012/05/23/wow-we-have-maxdop-calculator-for-sql-server-it-makes-my-job-easier/
These are just general recommendations for SQL Server and are a good starting point for setting the "max degree of parallelism" option.
Test-DbaMaxDop
[-SqlInstance] <DbaInstanceParameter[]>
[[-SqlCredential] <PSCredential>]
[-EnableException]
[<CommonParameters>]
PS C:\> Test-DbaMaxDop -SqlInstance sql2008, sqlserver2012
Get Max DOP setting for servers sql2008 and sqlserver2012 and also the recommended one.
PS C:\> Test-DbaMaxDop -SqlInstance sql2014 | Select-Object *
Shows Max DOP setting for server sql2014 with the recommended value. Piping the output to Select-Object * will also show the 'NumaNodes' and 'NumberOfCores' of each instance
PS C:\> Test-DbaMaxDop -SqlInstance sqlserver2016 | Select-Object *
Get Max DOP setting for servers sql2016 with the recommended value. Piping the output to Select-Object * will also show the 'NumaNodes' and 'NumberOfCores' of each instance. Because it is an 2016
instance will be shown 'InstanceVersion', 'Database' and 'DatabaseMaxDop' columns.
The target SQL Server instance or instances.
Alias | |
Required | True |
Pipeline | true (ByValue) |
Default Value |
Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.
Alias | |
Required | False |
Pipeline | false |
Default Value |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |