-
Notifications
You must be signed in to change notification settings - Fork 34
/
Copy pathdbatools Azure compression.ps1
59 lines (49 loc) · 1.77 KB
/
dbatools Azure compression.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
$admincredentials = New-Object System.Management.Automation.PSCredential ('jpomfret', (ConvertTo-SecureString -String 'P@ssword1234!' -AsPlainText -force))
$admincredentials = Get-Credential
$azureSplat = @{
SqlInstance = 'jesssqlserver7.database.windows.net'
SqlCredential = $admincredentials
Database = 'JessDb7'
}
Get-DbaDbCompression @azureSplat
<#
ComputerName : jesssqlserver7.database.windows.net
InstanceName :
SqlInstance : jesssqlserver7
Database : JessDb7
Schema : dbo
TableName : test
IndexName : PK__test__357D0D3E7957D1A6
Partition : 1
IndexID : 1
IndexType : ClusteredIndex
DataCompression : None
SizeCurrent :
RowCount : 100
#>
Test-DbaDbCompression @azureSplat
<#
WARNING: [20:45:15][Test-DbaDbCompression] Compression before SQLServer 2016 SP1 (13.0.4001.0) is only supported by enterprise, developer or evaluation edition. [jesssqlserver7.database.windows.net] has version 12.0.2000.8 and edition is SqlDatabase.
#>
Set-DbaDbCompression @azureSplat -CompressionType Page -Verbose
<#
ComputerName : jesssqlserver7.database.windows.net
InstanceName :
SqlInstance : jesssqlserver7
Database : JessDb7
Schema : dbo
TableName : test
IndexName :
Partition : 1
IndexID : 0
IndexType : ClusteredIndex
PercentScan :
PercentUpdate :
RowEstimatePercentOriginal :
PageEstimatePercentOriginal :
CompressionTypeRecommendation : PAGE
SizeCurrent :
SizeRequested :
PercentCompression :
AlreadyProcessed : True
#>