dbatools is a free PowerShell module with over 180 SQL Server administration, best practice and migration commands included.


Test-DbaOptimizeForAdHoc

Displays information relating to SQL Server Optimize for AdHoc Workloads setting. Works on SQL Server 2008-2016.

When this option is set, plan cache size is further reduced for single-use adhoc OLTP workload.

These are just general recommendations for SQL Server and are a good starting point for setting the “optimize for adhoc workloads” option. Check out Glenn Berry’s SQL Server Performance for more information.

Screenshots

Examples

Get Optimize for AdHoc Workloads setting for servers sql2008 and sqlserver2012 and also the recommended one.

Test-DbaOptimizeAdHoc -SqlServer sql2008, sqlserver2012

References

Author

This command was created by Brandon Abshire. You can find Brandon blogging at netnerds.net.

Get-Help

From PowerShell, execute Get-Help Test-DbaOptimizeForAdHoc -Detailed for more information on this function.

Source Code

Want to see the source code? View Test-DbaOptimizeForAdHoc.ps1 on GitHub
 

Related commands