Skip to content

Examples

Enrico van de Laar edited this page Dec 19, 2016 · 2 revisions

##Example 1: Export and replay

.\Query_Store_Replay.ps1 -SourceServer ServerA -SourceDatabase DatabaseA -TimeWindow 4 -TargetServer ServerB -TargetDatabase DatabaseB

The command above will extract all unique execution plans executed in the last 4 hours from DatabaseA that resides on ServerA and replays them against DatabaseB on ServerB.

##Example 2: Export only

\Query_Store_Replay.ps1 -SourceServer ServerA -SourceDatabase DatabaseA -TimeWindow 2 -ExportOnly $true

The command above will extract all the unique execution plans executed in the last 2 hours from DatabaseA on ServerA. There will be no replay of these queries against another database.

Clone this wiki locally