Author | Chrissy LeMaire (@cl), netnerds.net |
Availability | Windows, Linux, macOS |
Want to see the source code for this command? Check out Set-DbaDbFileGrowth on GitHub.
Want to see the Bill Of Health for this command? Check out Set-DbaDbFileGrowth.
Sets databases to a non-default growth and growth type. 64MB by default.
To get the file growth, use Get-DbaDbFile.
Sets databases to a non-default growth and growth type. 64MB by default.
To get the file growth, use Get-DbaDbFile.
Set-DbaDbFileGrowth
[[-SqlInstance] <DbaInstanceParameter[]>]
[[-SqlCredential] <PSCredential>]
[[-Database] <String[]>]
[[-GrowthType] <String>]
[[-Growth] <Int32>]
[[-FileType] <String>]
[[-InputObject] <Database[]>]
[-EnableException]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
PS C:\> Set-DbaDbFileGrowth -SqlInstance sql2016 -Database test -GrowthType GB -Growth 1
Sets the test database on sql2016 to a growth of 1GB
PS C:\> Get-DbaDatabase -SqlInstance sql2016 -Database test | Set-DbaDbFileGrowth -GrowthType GB -Growth 1
Sets the test database on sql2016 to a growth of 1GB
PS C:\> Get-DbaDatabase | Set-DbaDbFileGrowth -SqlInstance sql2017, sql2016, sql2012
Sets all database files on sql2017, sql2016, sql2012 to 64MB.
PS C:\> Set-DbaDbFileGrowth -SqlInstance sql2017, sql2016, sql2012 -Database test -WhatIf
Shows what would happen if the command were executed
PS C:\> Set-DbaDbFileGrowth -SqlInstance sql2017 -Database test -GrowthType GB -Growth 1 -FileType Data
Sets growth to 1GB for only data files for database test
The target SQL Server instance or instances.
Alias | |
Required | False |
Pipeline | false |
Default Value |
Login to the target instance using alternative credentials. Accepts PowerShell credentials (Get-Credential).
Windows Authentication, SQL Server Authentication, Active Directory - Password, and Active Directory - Integrated are all supported.
For MFA support, please use Connect-DbaInstance.
Alias | |
Required | False |
Pipeline | false |
Default Value |
The name of the target databases
Alias | |
Required | False |
Pipeline | false |
Default Value |
The growth type, MB by default - valid values are MB, KB, GB or TB.
Alias | |
Required | False |
Pipeline | false |
Default Value | MB |
Accepted Values | KB,MB,GB,TB |
The growth value. 64 by default.
Alias | |
Required | False |
Pipeline | false |
Default Value | 64 |
Apply changes to only DATA, LOG or ALL files
Alias | |
Required | False |
Pipeline | false |
Default Value | All |
Accepted Values | All,Data,Log |
Allows piping from Get-DbaDatabase
Alias | |
Required | False |
Pipeline | true (ByValue) |
Default Value |
By default, when something goes wrong we try to catch it, interpret it and give you a friendly warning message.
This avoids overwhelming you with "sea of red" exceptions, but is inconvenient because it basically disables advanced scripting.
Using this switch turns this "nice by default" feature off and enables you to catch exceptions with your own try/catch.
Alias | |
Required | False |
Pipeline | false |
Default Value | False |
If this switch is enabled, no actions are performed but informational messages will be displayed that explain what would happen if the command were to run
Alias | wi |
Required | False |
Pipeline | false |
Default Value |
If this switch is enabled, you will be prompted for confirmation before executing any operations that change state
Alias | cf |
Required | False |
Pipeline | false |
Default Value |