Thor Logo dbatools

Get-DbaDump

View Source
Garry Bargsley (@gbargsley), blog.garrybargsley.com
Windows, Linux, macOS

Synopsis

Retrieves SQL Server memory dump file information from sys.dm_server_memory_dumps DMV.

Description

Queries the sys.dm_server_memory_dumps dynamic management view to return details about memory dump files (.mdmp) generated by SQL Server. Memory dumps are created when SQL Server encounters crashes, assertion failures, or other critical errors that require investigation. This function helps DBAs quickly identify when dumps have been generated, their size, and creation time, which is essential for troubleshooting server stability issues and working with Microsoft Support for crash analysis.

Syntax

Get-DbaDump
    [-SqlInstance] <DbaInstanceParameter[]>
    [[-SqlCredential] <PSCredential>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Get-DbaDump -SqlInstance sql2016

Shows the detailed information for memory dump(s) located on sql2016 instance

Example: 2
PS C:\> Get-DbaDump -SqlInstance sql2016 -SqlCredential sqladmin

Shows the detailed information for memory dump(s) located on sql2016 instance. Logs into the SQL Server using the SQL login ‘sqladmin’

Required Parameters

-SqlInstance

The target SQL Server instance or instances. This can be a collection and receive pipeline input to allow the function to be executed against multiple SQL Server instances.

PropertyValue
Alias
RequiredTrue
Pipelinetrue (ByValue)
Default Value

Optional Parameters

-SqlCredential

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.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default Value
-EnableException

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.

PropertyValue
Alias
RequiredFalse
Pipelinefalse
Default ValueFalse

Outputs

PSCustomObject

Returns one object per memory dump file found on the SQL Server instance. Each object contains information about a single .mdmp file created by SQL Server for crash diagnostics.

Properties:

  • ComputerName: The computer name of the SQL Server instance
  • InstanceName: The SQL Server instance name
  • SqlInstance: The full SQL Server instance name (computer\instance)
  • FileName: The file path and name of the memory dump file (.mdmp)
  • CreationTime: DateTime indicating when the memory dump was created
  • Size: The size of the memory dump file (formatted as dbasize for easy human-readable display, e.g., “1.5 GB”)