You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: samples/manage/azure-sql-db-elastic-pools/readme.md
+2-54Lines changed: 2 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,14 +22,10 @@ This readme applies to the PowerShell scripts: PoolTelemetryJobRunner.ps1 and Po
22
22
[Customizing the PoolTelemetryJobRunner script](#customizing-the-pooltelemetryjobrunner-script)<br/>
23
23
[Executing the runner script](#executing-the-runner-script)<br/>
24
24
[Inspecting the telemetry that is collected](#inspecting-the-telemetry-that-is-collected)<br/>
25
-
<<<<<<< HEAD
26
-
=======
27
25
[Power BI](#power-bi)<br/>
28
-
>>>>>>> decdc4e2faa3ac0192d70adb7d1673755bfb7768
29
26
[Disclaimers](#disclaimers)<br/>
30
27
[Related links](#related-links)<br/>
31
28
32
-
33
29
<aname=what-do-the-powershell-scripts-do?></a>
34
30
35
31
## What do the PowerShell scripts do?
@@ -38,7 +34,7 @@ The scripts are used to extract telemetry data associated with SQL Database elas
38
34
39
35
There is a runner script, PoolTelemetryRunner.ps1, which needs to be modified for your environment to identify one or more servers on which elastic pools and databases are hosted and a telemetry database in which telemetry data is to be gathered. The runner script executes a function in the data collection script, PoolTelemetry.ps1 as a PowerShell job for each server.
40
36
41
-
Each data collection job executes in the background on a pre-determined schedule and will on first execution create the required schema in the telemetry database. It then connects to the master database on the server and retrieves elastic pool telemetry data and loads that to the telemetry database. It can optionally look back 14 days on first execution to get all available telemetry.
37
+
Each data collection job executes in the background on a pre-determined schedule and will on first execution create the required schema in the telemetry database. It then connects to the master database on the server and retrieves elastic pool telemetry data and loads that to the telemetry database. It can optionally look back 14 days on first execution to get all available telemetry.
42
38
43
39
It then optionally queries the master database to determine the current elastic databases on the server, resident in each of the pools identified in the prior step. It then connects to each database in turn and retrieves and loads telemetry data for that database. It then sleeps for a period before waking up and repeating the data collection cycle.
44
40
@@ -87,7 +83,6 @@ Provide the server name if data is to be gathered from all a specific server.
87
83
### Telemetry server and database
88
84
89
85
It is assumed that telemetry is to be loaded to an Azure SQL Database.
90
-
<<<<<<< HEAD
91
86
92
87
Provide the telemetry database server name.
93
88
@@ -129,49 +124,6 @@ The script allows either a single server to be specified or multiple. Several s
129
124
130
125
The runner script PoolTelemetryRunner.ps1 should be executed from within an Azure PowerShell context.
131
126
132
-
=======
133
-
134
-
Provide the telemetry database server name.
135
-
136
-
``` $outputServerName = '<telemetry server name>’ ```
### Define if the server to be monitored will change during the monitoring period
143
-
144
-
If the set of servers being monitored may change during the overall monitoring period then set $staticServerList to $false to cause server evaluation to be repeated periodically. If this is set to false, the runner script will run for the same duration as the job scripts, and will start additional jobs if new servers are added and stop jobs if servers are removed from the query scope. Otherwise if set to $true, the runner script will complete as soon as the jobs have been spawned.
145
-
146
-
``` $staticServerList = $true ```
147
-
148
-
### Collection interval, lag-time and job duration
149
-
150
-
Provide the interval in minutes. This defines both how far back the data collection will look on each execution and the interval between executions. A value between 15-30 minutes is probably most appropriate. Note that fine-grained database telemetry (15 second averages) is only retained in each database for 60 minutes, beyond that it based on 5 minute averages. Pool telemetry in the master database is always based on 5 minute averages. Pool telemetry is not available immediately. A lag time of 30 minutes is programmed in the collection script. It is not recommended to change this lag setting. The effect of this is that the look-back window for pool data is pushed back, by this lag time so if gathering data for 15 interval the query window is -45 minutes to -30 minutes on each execution. Note that the lag time setting does not affect gathering 15s averaged telemetry from each database, which is available immediately. 5 minute averaged data is retained for 14 days.
151
-
152
-
``` $intervalMinutes = 15 ```
153
-
154
-
Provide the job duration in minutes. This defines how long the job will execute for in the background. A value of zero will cause the job to execute once only. The value is best
155
-
156
-
``` $durationMinutes = 600 ```
157
-
158
-
### Load all available pool telemetry
159
-
160
-
In normal execution the spawned jobs look back 'window' is based on the interval and lag settings. For pool telemetry which is available for 14 days, the data collection script can be configured to look back 15 days on its first execution to ensue it gathers all available telemetry for each pool. Be careful if you stop the runner script and restart it on the same servers within this 15 day period as it may gather and load duplicate data entries. Using this option with many pools may load a large amount of data.
161
-
162
-
``` $loadAllAvailablePoolTelemetry = $true ```
163
-
164
-
### Specify the source server(s) to use
165
-
166
-
The script allows either a single server to be specified or multiple. Several sample PowerShell scripted queries are provided but in general only one should be used, the others should be commented out. The script requires that the $servers variable is populated as input to the job execution. Either uncomment and use one of the queries that populates $servers or use one of the queries that populates $resourceList and then uncomment the section in the script that uses the $resourceList to populate $servers. If not using $resourceList leave this translation section commented out.
167
-
168
-
<aname=executing-the-runner-script></a>
169
-
170
-
## Executing the runner script
171
-
172
-
The runner script PoolTelemetryRunner.ps1 should be executed from within an Azure PowerShell context.
173
-
174
-
>>>>>>> decdc4e2faa3ac0192d70adb7d1673755bfb7768
175
127
The script will prompt for Azure login and the user name and password for the source servers and the user name and password for the telemetry server. It will then spawn a PowerShell job for each server that has been identified within the script. Each job will run in the background for the time specified in $durationMinutes.
176
128
177
129
It will gather data for the most recent period defined by the interval value and load this, then sleep until the next data gathering point, wake up, gather and load more data and then sleep again, etc.
@@ -219,8 +171,6 @@ For example, once the telemetry is being collected, this TVF can be called with
219
171
Data can be queried while data collection is in progress.
220
172
221
173
> [AZURE.NOTE] If the scripts are stopped and started again within a short period they may add duplicate rows to the telemetry tables.
222
-
<<<<<<< HEAD
223
-
=======
224
174
225
175
<aname=power-bi></a>
226
176
@@ -233,7 +183,6 @@ A sample Power BI designer (PBIX) file is also provided in this location (which
233
183
- Refresh the report to get current data.
234
184
- The report will show the busiest top 5 elastic pools over the last 6 hours, 24 hours and 7 days.
235
185
- This report can also be published as a dashboard to your organization’s PowerBI site for use by others in your organization.
236
-
>>>>>>> decdc4e2faa3ac0192d70adb7d1673755bfb7768
237
186
238
187
<aname=disclaimers></a>
239
188
@@ -253,5 +202,4 @@ For more information, see these articles:
253
202
254
203
-[Monitor and manage an elastic database pool with Transact-SQL](https://azure.microsoft.com/documentation/articles/sql-database-elastic-pool-manage-tsql/)
255
204
256
-
-[Monitor and manage an elastic database pool with the Azure portal](https://azure.microsoft.com/documentation/articles/sql-database-elastic-pool-manage-portal/)
257
-
205
+
-[Monitor and manage an elastic database pool with the Azure portal](https://azure.microsoft.com/documentation/articles/sql-database-elastic-pool-manage-portal/)
0 commit comments