Thor Logo dbatools

Tempdb

Get-DbaTempdbUsage

Chrissy LeMaire (@cl), netnerds.net

Get-DbaTempdbUsage View Source Chrissy LeMaire (@cl), netnerds.net Windows, Linux, macOS Synopsis Gets Tempdb usage for running queries. Description This function queries DMVs for running sessions using tempdb and returns results if those sessions have user or internal space allocated or deallocated against them. Syntax Get-DbaTempdbUsage [-SqlInstance] <DbaInstanceParameter[]> [[-SqlCredential] <PSCredential>] [-EnableException] [<CommonParameters>] Examples Example: 1 PS C:\> Get-DbaTempdbUsage -SqlInstance localhost\SQLDEV2K14 Gets tempdb usage for localhost\SQLDEV2K14 Required Parameters -SqlInstance The target SQL Server instance or instances.

Read more

Set-DbaTempDbConfig

Michael Fal (@Mike_Fal), mikefal.net

Set-DbaTempDbConfig View Source Michael Fal (@Mike_Fal), mikefal.net Windows, Linux, macOS Synopsis Configures tempdb database files according to Microsoft best practices for optimal performance Description Configures tempdb database files to follow Microsoft’s recommended best practices for performance optimization. This function calculates the optimal number of data files based on logical CPU cores (capped at 8) and distributes the specified total data file size evenly across those files. You must specify the target SQL Server instance and total data file size as mandatory parameters.

Read more

Test-DbaTempDbConfig

Michael Fal (@Mike_Fal), mikefal.net

Test-DbaTempDbConfig View Source Michael Fal (@Mike_Fal), mikefal.net Windows, Linux, macOS Synopsis Tests tempdb configuration against SQL Server best practices and returns compliance status for each rule. Description Performs a comprehensive audit of tempdb configuration against Microsoft’s recommended best practices, returning detailed compliance results for each rule. This saves DBAs from manually checking multiple tempdb settings and provides clear guidance on which configurations need attention. The function evaluates six critical areas of tempdb configuration:

Read more