18
18
#>
19
19
function Test-CreateDatabase
20
20
{
21
- Test-CreateDatabaseInternal " 12.0"
21
+ Test-CreateDatabaseInternal " 12.0" " Southeast Asia "
22
22
}
23
23
24
24
<#
@@ -61,6 +61,18 @@ function Test-CreateDatabaseInternal ($serverVersion, $location = "Japan East")
61
61
Assert-NotNull $db.Edition
62
62
Assert-NotNull $db.CurrentServiceObjectiveName
63
63
Assert-NotNull $db.CollationName
64
+
65
+ # Create data warehouse database with all parameters.
66
+ $databaseName = Get-DatabaseName
67
+ $collationName = " SQL_Latin1_General_CP1_CI_AS"
68
+ $maxSizeBytes = 250 GB
69
+ $dwdb = New-AzureSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName `
70
+ - CollationName $collationName - MaxSizeBytes $maxSizeBytes - Edition DataWarehouse - RequestedServiceObjectiveName DW100
71
+ Assert-AreEqual $dwdb.DatabaseName $databaseName
72
+ Assert-AreEqual $dwdb.MaxSizeBytes $maxSizeBytes
73
+ Assert-AreEqual $dwdb.Edition DataWarehouse
74
+ Assert-AreEqual $dwdb.CurrentServiceObjectiveName DW100
75
+ Assert-AreEqual $dwdb.CollationName $collationName
64
76
}
65
77
66
78
# Create with all parameters
@@ -95,7 +107,7 @@ function Test-CreateDatabaseInternal ($serverVersion, $location = "Japan East")
95
107
#>
96
108
function Test-UpdateDatabase
97
109
{
98
- Test-UpdateDatabaseInternal " 12.0"
110
+ Test-UpdateDatabaseInternal " 12.0" " Southeast Asia "
99
111
}
100
112
101
113
<#
@@ -144,10 +156,24 @@ function Test-UpdateDatabaseInternal ($serverVersion, $location = "Japan East")
144
156
Assert-AreEqual $db2.Edition Standard
145
157
Assert-AreEqual $db2.CurrentServiceObjectiveName S1
146
158
Assert-AreEqual $db2.CollationName $db.CollationName
159
+
160
+ # Create and alter data warehouse database.
161
+ $databaseName = Get-DatabaseName
162
+ $collationName = " SQL_Latin1_General_CP1_CI_AS"
163
+ $maxSizeBytes = 250 GB
164
+ $dwdb = New-AzureSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName `
165
+ - CollationName $collationName - MaxSizeBytes $maxSizeBytes - Edition DataWarehouse - RequestedServiceObjectiveName DW100
166
+
167
+ $dwdb2 = Set-AzureSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $dwdb.DatabaseName `
168
+ - MaxSizeBytes $maxSizeBytes - RequestedServiceObjectiveName DW200 - Edition DataWarehouse
169
+ Assert-AreEqual $dwdb2.DatabaseName $dwdb.DatabaseName
170
+ Assert-AreEqual $dwdb2.MaxSizeBytes $maxSizeBytes
171
+ Assert-AreEqual $dwdb2.Edition DataWarehouse
172
+ Assert-AreEqual $dwdb2.CurrentServiceObjectiveName DW200
173
+ Assert-AreEqual $dwdb2.CollationName $collationName
147
174
}
148
175
else
149
176
{
150
-
151
177
# Alter all properties
152
178
$db1 = Set-AzureSqlDatabase - ResourceGroupName $db.ResourceGroupName - ServerName $db.ServerName - DatabaseName $db.DatabaseName `
153
179
- MaxSizeBytes 1 GB - Edition Basic - RequestedServiceObjectiveName Basic
@@ -179,7 +205,7 @@ function Test-UpdateDatabaseInternal ($serverVersion, $location = "Japan East")
179
205
#>
180
206
function Test-GetDatabase
181
207
{
182
- Test-GetDatabaseInternal " 12.0"
208
+ Test-GetDatabaseInternal " 12.0" " Southeast Asia "
183
209
}
184
210
185
211
<#
@@ -214,6 +240,28 @@ function Test-GetDatabaseInternal ($serverVersion, $location = "Japan East")
214
240
215
241
try
216
242
{
243
+ if ($serverVersion -eq " 12.0" )
244
+ {
245
+ # Create data warehouse database.
246
+ $databaseName = Get-DatabaseName
247
+ $dwdb = New-AzureSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName `
248
+ - CollationName SQL_Latin1_General_CP1_CI_AS - MaxSizeBytes 250 GB - Edition DataWarehouse - RequestedServiceObjectiveName DW100
249
+ $dwdb2 = Get-AzureSqlDatabase - ResourceGroupName $rg.ResourceGroupname - ServerName $server.ServerName - DatabaseName $dwdb.DatabaseName
250
+ Assert-AreEqual $dwdb2.DatabaseName $dwdb.DatabaseName
251
+ Assert-AreEqual $dwdb2.MaxSizeBytes $dwdb.MaxSizeBytes
252
+ Assert-AreEqual $dwdb2.Edition $dwdb.Edition
253
+ Assert-AreEqual $dwdb2.CurrentServiceObjectiveName $dwdb.CurrentServiceObjectiveName
254
+ Assert-AreEqual $dwdb2.CollationName $dwdb.CollationName
255
+
256
+ $all = $server | Get-AzureSqlDatabase
257
+ Assert-AreEqual $all.Count 4 # 4 because master database is included
258
+ }
259
+ else
260
+ {
261
+ $all = $server | Get-AzureSqlDatabase
262
+ Assert-AreEqual $all.Count 3 # 3 because master database is included
263
+ }
264
+
217
265
$gdb1 = Get-AzureSqlDatabase - ResourceGroupName $server.ResourceGroupname - ServerName $server.ServerName - DatabaseName $db1.DatabaseName
218
266
Assert-NotNull $gdb1
219
267
Assert-AreEqual $db1.DatabaseName $gdb1.DatabaseName
@@ -229,9 +277,6 @@ function Test-GetDatabaseInternal ($serverVersion, $location = "Japan East")
229
277
Assert-AreEqual $db2.CollationName $gdb2.CollationName
230
278
Assert-AreEqual $db2.CurrentServiceObjectiveName $gdb2.CurrentServiceObjectiveName
231
279
Assert-AreEqual $db2.MaxSizeBytes $gdb2.MaxSizeBytes
232
-
233
- $all = $server | Get-AzureSqlDatabase
234
- Assert-AreEqual $all.Count 3 # 3 because master database is included
235
280
}
236
281
finally
237
282
{
@@ -246,7 +291,7 @@ function Test-GetDatabaseInternal ($serverVersion, $location = "Japan East")
246
291
#>
247
292
function Test-RemoveDatabase
248
293
{
249
- Test-RemoveDatabaseInternal " 12.0"
294
+ Test-RemoveDatabaseInternal " 12.0" " Southeast Asia "
250
295
}
251
296
252
297
<#
@@ -281,9 +326,20 @@ function Test-RemoveDatabaseInternal ($serverVersion, $location = "Japan East")
281
326
282
327
try
283
328
{
284
- $all = $server | Get-AzureSqlDatabase
285
- Assert-AreEqual $all.Count 3 # 3 because master database is included
329
+ if ($serverVersion -eq " 12.0" )
330
+ {
331
+ # Create data warehouse database
332
+ $databaseName = Get-DatabaseName
333
+ $dwdb = New-AzureSqlDatabase - ResourceGroupName $rg.ResourceGroupName - ServerName $server.ServerName - DatabaseName $databaseName `
334
+ - CollationName " SQL_Latin1_General_CP1_CI_AS" - MaxSizeBytes 250 GB - Edition DataWarehouse - RequestedServiceObjectiveName DW100
335
+ Assert-AreEqual $dwdb.DatabaseName $databaseName
286
336
337
+ Remove-AzureSqlDatabase - ResourceGroupName $server.ResourceGroupname - ServerName $server.ServerName - DatabaseName $dwdb.DatabaseName - Force
338
+ }
339
+
340
+ $all = $server | Get-AzureSqlDatabase
341
+ Assert-AreEqual $all.Count 3 # 3 because master database is included
342
+
287
343
Remove-AzureSqlDatabase - ResourceGroupName $server.ResourceGroupname - ServerName $server.ServerName - DatabaseName $db1.DatabaseName - Force
288
344
289
345
$db2 | Remove-AzureSqlDatabase - Force
0 commit comments