Skip to content

Commit 17e5020

Browse files
Edits to improve SEO and usability
1 parent 3ffc9f5 commit 17e5020

2 files changed

Lines changed: 106 additions & 88 deletions

File tree

docs/dea/database-experimentation-assistant-run-command-prompt.md

Lines changed: 75 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,16 @@
11
---
22
title: Run Database Experimentation Assistant at a command prompt
33
description: Learn how to capture a trace in Database Experimentation Assistant (DEA) and then analyze the results, all from a command prompt.
4-
ms.custom: "seo-lt-2019"
5-
ms.date: 02/25/2020
4+
ms.custom:
5+
- "seo-lt-2019"
6+
- kr2b-contr-experiment
7+
ms.date: 05/18/2022
68
ms.prod: sql
79
ms.prod_service: dea
810
ms.suite: sql
911
ms.technology: dea
1012
ms.tgt_pltfrm: ""
11-
ms.topic: conceptual
13+
ms.topic: how-to
1214
author: pochiraju
1315
ms.author: rajpo
1416
ms.reviewer: mathoma
@@ -18,114 +20,128 @@ ms.reviewer: mathoma
1820

1921
This article describes how to capture a trace in Database Experimentation Assistant (DEA) and then analyze the results, all from a command prompt.
2022

21-
> [!NOTE]
22-
> To learn more about each DEA operation, try running the following command:
23-
>
24-
> `Deacmd.exe -o <operation> --help`
25-
>
26-
> An operation name is required; valid operations are **Analysis**, **StartCapture**, and **StopCapture**.
23+
> [!NOTE]
24+
> To learn more about each DEA operation, try running the following command:
25+
>
26+
> `Deacmd.exe -o <operation> --help`
27+
>
28+
> An operation name is required. Valid operations are **Analysis**, **StartCapture**, and **StopCapture**.
2729
2830
## Start a new workload capture by using the DEA command
2931

3032
To start a new workload capture, at a command prompt, run the following command:
3133

32-
`Deacmd.exe -o StartCapture -n <Trace FileName> -x <Trace Format> -h <SQLServerInstance> -f <database name> -e <Encrypt Connection> -m <Authetication Mode> -u <user name> -p <password> -l <Location of Output Folder> -d <duration>`
34+
```cmd
35+
Deacmd.exe -o StartCapture -n <Trace FileName> -x <Trace Format> -h <SQLServerInstance> -f <database name> -e <Encrypt Connection> -m <Authetication Mode> -u <user name> -p <password> -l <Location of Output Folder> -d <duration>
36+
```
3337

34-
**Example**
38+
For example:
3539

36-
`Deacmd.exe -o StartCapture -n sql2008capture -x 0 -h localhost -f adventureworks -e --trust -m 0 -l c:\test -d 60`
40+
```cmd
41+
Deacmd.exe -o StartCapture -n sql2008capture -x 0 -h localhost -f adventureworks -e --trust -m 0 -l c:\test -d 60
42+
```
3743

38-
**Additional options**
39-
40-
When starting a new workload capture with the `Deacmd.exe` command, you can use the following additional options:
44+
When you start a new workload capture with the `Deacmd.exe` command, you can use the following other options:
4145

4246
| Option| Description |
4347
| --- | --- |
44-
| -n, --name | Required; trace file name |
45-
| -x, --format | Required; format of the trace (Trace = 0, XEvents = 1) |
46-
| -d, --duration | Required; maximum duration for the capture, in minutes |
47-
| -l, --location | Required; location of output folder for storing trace / xevent files on the host computer |
48-
| -t, --type | (Default: 0) Type / Edition of the Sql Server (SqlServer = 0, AzureSQLDB = 1, Azure SQL Managed Instance = 2) |
49-
| -h, --host | Required; SQL Server host name and/or instance name to start the capture |
50-
| -e, --encrypt | (Default: True) Encrypt connection to SQL Server Instance. Default is true |
51-
| --trust | (Default: False) Trust server certificate while connecting to SQL Server Instance. Default is false |
52-
| -f, --databasename | (Default: ) Name of the database to filter your traces, if not specified the capture will start on all the databases |
53-
| -m, --authmode | (Default: 0) Authentication Mode (Windows = 0, Sql Authentication = 1) |
54-
| -u, --username | User name for connecting to the SQL Server |
55-
| -p, --password | Password for connecting to the SQL Server |
48+
| `-n`, `--name` | Required. Trace file name |
49+
| `-x`, `--format` | Required. Format of the trace (Trace = 0, XEvents = 1) |
50+
| `-d`, `--duration` | Required. Maximum duration for the capture, in minutes |
51+
| `-l`, `--location` | Required. Location of output folder for storing trace / xevent files on the host computer |
52+
| `-t`, `--type` | Default: 0. Type / Edition of the Sql Server (SqlServer = 0, AzureSQLDB = 1, Azure SQL Managed Instance = 2) |
53+
| `-h`, `--host` | Required. SQL Server host name and/or instance name to start the capture |
54+
| `-e`, `--encrypt` | Default: True. Encrypt connection to SQL Server Instance.|
55+
| `--trust` | Default: False. Trust server certificate while connecting to SQL Server Instance |
56+
| `-f`, `--databasename` | Name of the database to filter your traces, if not specified the capture will start on all the databases |
57+
| `-m`, `--authmode` | Default: 0. Authentication Mode (Windows = 0, Sql Authentication = 1) |
58+
| `-u`, `--username` | User name for connecting to the SQL Server |
59+
| `-p`, `--password` | Password for connecting to the SQL Server |
5660

5761
## Replay a workload capture
5862

59-
**Using Distributed Replay**
60-
6163
If you're using Distributed Replay, perform the following steps.
6264

63-
1. Log in to the Distributed Replay controller computer.
65+
1. Sign in to the Distributed Replay controller computer.
6466
2. To convert the workload trace that you captured using the DEA command to an IRF file, at a command prompt, run the following command:
6567

66-
`DReplay preprocess -m "dreplaycontroller" -i "Path to first trace file" -d "<Folder path on controller>\IrfFolder"`
68+
```cmd
69+
DReplay preprocess -m "dreplaycontroller" -i "Path to first trace file" -d "<Folder path on controller>\IrfFolder"
70+
```
6771

68-
3. Start a trace capture on the target computer running SQL Server using StartReplayCaptureTrace.sql.
72+
3. Start a trace capture on the target computer running SQL Server using `StartReplayCaptureTrace.sql`.
6973

7074
a. In SQL Server Management Studio (SSMS), open <Dea_InstallPath\>\Scripts\StartReplayCaptureTrace.sql.
7175

7276
b. Run `Set @durationInMins=0` so that the trace capture doesn't stop automatically after a specified time.
7377

74-
c. To set the max file size per trace file, run `Set @maxfilesize`. The recommended size is 200 (in MB).
78+
c. To set the maximum file size per trace file, run `Set @maxfilesize`. The recommended size is 200, in MB.
7579

7680
d. Edit `@Tracefile` to set a unique name for your trace file.
7781

7882
e. Edit `@dbname` to specify a database name if the workload must be captured only on a specific database. By default, the workload on the entire server is captured.
7983

8084
4. To replay the IRF file against the target SQL Server instance, at a command prompt, run the following command:
8185

82-
`DReplay replay -m "dreplaycontroller" -d "<Folder Path on Dreplay Controller>\IrfFolder" -o -s "SQL2016Target" -w "dreplaychild1,dreplaychild2,dreplaycild3,dreplaychild4"`
86+
```cmd
87+
DReplay replay -m "dreplaycontroller" -d "<Folder Path on Dreplay Controller>\IrfFolder" -o -s "SQL2016Target" -w "dreplaychild1,dreplaychild2,dreplaycild3,dreplaychild4"
88+
```
89+
90+
a. To monitor the status, run the following command:
8391
84-
a. To monitor the status, at a command prompt, run `DReplay status -f 1`.
92+
```cmd
93+
DReplay status -f 1
94+
```
8595
86-
b. To stop the replay, for example if you see that the pass % is lower than expected, at a command prompt, run `DReplay cancel`.
96+
b. To stop the replay, for example if you see that the pass percentage is lower than expected, run the following command:
97+
98+
```cmd
99+
DReplay cancel
100+
```
87101
88102
5. Stop the trace capture on the target SQL Server instance.
89103
6. In SSMS, open `<Dea_InstallPath>\Scripts\StopCaptureTrace.sql`.
90104
7. Edit `@Tracefile` to match the trace file path on the target computer running SQL Server.
91105
8. Run the script against the target computer running SQL Server.
92106
93-
**Using InBuilt Replay**
107+
## Using InBuilt Replay
94108
95-
If you are using InBuilt Replay, you won't have to set up Distributed Replay. The ability to use InBuilt Replay via the command line is on the way, but in the interim, you can use our GUI to run replay using InBuilt Replay.
109+
If you're using InBuilt Replay, you won't have to set up Distributed Replay. The ability to use InBuilt Replay by using the command line is on the way. Currently, you can use our GUI to run replay using InBuilt Replay.
96110
97111
## Analyze traces using the DEA command
98112
99113
To start a new trace analysis, at a command prompt, run the following command:
100114
101-
`Deacmd.exe -o analysis -a <Target1 trace filepath> -b <Target2 trace filepath> -r reportname -h <SQLserverInstance> -e <encryptconnection> -u <username>`
102-
103-
**Example**
115+
```cmd
116+
Deacmd.exe -o analysis -a <Target1 trace filepath> -b <Target2 trace filepath> -r reportname -h <SQLserverInstance> -e <encryptconnection> -u <username>
117+
```
104118

105-
`Deacmd.exe -o analysis -a C:\Trace\SQL2008Source\Trace.trc -b C:\ Trace\SQL2014Trace\Trace.trc -r upgrade20082014 -h localhost -e`
119+
For example:
106120

107-
To view the analysis reports of these trace files, you need to use the GUI to view charts and organized metrics. However, the analysis database is written to the SQL Server instance specified, so you can also query the generated analysis tables directly.
121+
```cmd
122+
Deacmd.exe -o analysis -a C:\Trace\SQL2008Source\Trace.trc -b C:\ Trace\SQL2014Trace\Trace.trc -r upgrade20082014 -h localhost -e
123+
```
108124

109-
**Additional options**
125+
To view the analysis reports of these trace files, you need to use the GUI to view charts and organized metrics. However, the analysis database is written to the SQL Server instance specified, so you can also query the generated analysis tables directly.
110126

111-
When analyzing traces using the DEA command, you can use the following additional options:
127+
When analyzing traces using the DEA command, you can use the following other options:
112128

113129
| Option| Description |
114130
| --- | --- |
115-
| -a, --traceA | Required; file path to the event file for A instance. Example C:\traces\Sql2008trace.trc. If there's a batch of files, select the first file and DEA will check for rollover files automatically. If files are in blob, provide the folder path where you want the event files stored locally. Example C:\traces\ |
116-
| -b, --traceB | Required; file path to the event file for B instance. Example C:\traces\Sql2014trace.trc. If there's a batch of files, select the first file and DEA will check for rollover files automatically. If files are in blob, provide the folder path where you want the event files stored locally. Example C:\traces\ |
117-
| -r, --ReportName | Required; name for current analysis. The analysis report that gets generated will be identified by this name. |
118-
| -t, --type | (Default: 0) Type / Edition of the Sql Server (SqlServer = 0, AzureSQLDB = 1, Azure SQL Managed Instance = 2) |
119-
| -h, --host | Required; SQL Server host name and/or instance name |
120-
| -e, --encrypt | (Default: True) Encrypt connection to SQL Server Instance. Default is true |
121-
| --trust | (Default: False) Trust server certificate while connecting to SQL Server Instance. Default is false |
122-
| -m, --authmode | (Default: 0) Authentication Mode (Windows = 0, Sql Authentication = 1) |
123-
| -u, --username | User name for connecting to the SQL Server |
124-
| --p | Password for connecting to the SQL Server |
125-
| --ab | (Default: False) Storage location of trace A is in blob. If used, must also specify --abu (Trace A Blob Url) |
126-
| --bb | (Default: False) Storage location of trace B is in blob. If used, must also specify --bbu (Trace B Blob Url) |
127-
| --abu | Blob URL for A instance with SAS key |
128-
| --bbu | Blob URL for B instance with SAS key |
131+
| `-a`, `--traceA` | Required. File path to the event file for A instance. Example: *C:\traces\Sql2008trace.trc*. If there's a batch of files, select the first file and DEA checks for rollover files automatically. If files are in blob, provide the folder path where you want the event files stored locally. Example: *C:\traces\\* |
132+
| `-b`, `--traceB` | Required. File path to the event file for B instance. Example: *C:\traces\Sql2014trace.trc*. If there's a batch of files, select the first file and DEA checks for rollover files automatically. If files are in blob, provide the folder path where you want the event files stored locally. Example: *C:\traces\\* |
133+
| `-r`, `--ReportName` | Required. Name for current analysis. The analysis report that gets generated will be identified by this name. |
134+
| `-t`, `--type` | Default: 0. Type / Edition of the SQL Server (SqlServer = 0, AzureSQLDB = 1, Azure SQL Managed Instance = 2) |
135+
| `-h`, `--host` | Required. SQL Server host name and/or instance name |
136+
| `-e`, `--encrypt` | Default: True. Encrypt connection to SQL Server Instance.|
137+
| `--trust` | Default: False. Trust server certificate while connecting to SQL Server Instance. |
138+
| `-m`, `--authmode` | Default: 0. Authentication Mode (Windows = 0, Sql Authentication = 1) |
139+
| `-u`, `--username` | User name for connecting to the SQL Server |
140+
| `--p` | Password for connecting to the SQL Server |
141+
| `--ab` | Default: False. Storage location of trace A is in blob. If used, must also specify `--abu (Trace A Blob Url)` |
142+
| `--bb` | Default: False. Storage location of trace B is in blob. If used, must also specify `--bbu (Trace B Blob Url)` |
143+
| `--abu` | Blob URL for A instance with SAS key |
144+
| `--bbu` | Blob URL for B instance with SAS key |
129145

130146
## See also
131147

0 commit comments

Comments
 (0)