Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Invoke-DbaXEReplay on GitHub.
Want to see the Bill Of Health for this command? Check out Invoke-DbaXEReplay.
This command replays events from Read-DbaXEFile on one or more target servers
This command replays events from Read-DbaXEFile. It is simplistic in its approach.
Invoke-DbaXEReplay
[-SqlInstance] <DbaInstanceParameter[]>
[[-SqlCredential] <PSCredential>]
[[-Database] <String[]>]
[[-Event] <String[]>]
[-InputObject] <Object>
[-Raw]
[-EnableException]
[<CommonParameters>]
PS C:\> Read-DbaXEFile -Path C:\temp\sample.xel | Invoke-DbaXEReplay -SqlInstance sql2017
Runs all batch_text for sql_batch_completed against tempdb on sql2017.
PS C:\> Read-DbaXEFile -Path C:\temp\sample.xel | Invoke-DbaXEReplay -SqlInstance sql2017 -Database planning -Event sql_batch_completed
Sets the initial database to planning then runs only sql_batch_completed against sql2017.
PS C:\> Read-DbaXEFile -Path C:\temp\sample.xel | Invoke-DbaXEReplay -SqlInstance sql2017, sql2016
Runs all batch_text for sql_batch_completed against tempdb on sql2017 and sql2016.
Target SQL Server(s)
Alias | |
Required | True |
Pipeline | false |
Default Value |
Accepts the object output of Read-DbaXESession.
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 |
The initial starting database.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Each Response can be limited to processing specific events, while ignoring all the other ones. When this attribute is omitted, all events are processed.
Alias | |
Required | False |
Pipeline | false |
Default Value | @('sql_batch_completed', 'rcp_completed') |
By dafault, the results of sqlcmd are collected, cleaned up and displayed. If you'd like to see all results immeidately, use Raw.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
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 |