commands

^

Find-DbaDbGrowthEvent

Author Aaron Nelson
Availability Windows, Linux, macOS

 

Want to see the source code for this command? Check out Find-DbaDbGrowthEvent on GitHub.
Want to see the Bill Of Health for this command? Check out Find-DbaDbGrowthEvent.

Synopsis

Finds any database AutoGrow events in the Default Trace.

Description

Finds any database AutoGrow events in the Default Trace.

The following events are included:
92 - Data File Auto Grow
93 - Log File Auto Grow
94 - Data File Auto Shrink
95 - Log File Auto Shrink

Syntax

Find-DbaDbGrowthEvent
    [-SqlInstance] <DbaInstanceParameter[]>
    [[-SqlCredential] <PSCredential>]
    [[-Database] <Object[]>]
    [[-ExcludeDatabase] <Object[]>]
    [[-EventType] <String>]
    [[-FileType] <String>]
    [-UseLocalTime]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Find-DbaDbGrowthEvent -SqlInstance localhost

Returns any database AutoGrow events in the Default Trace with UTC time for the instance for every database on the localhost instance.

Example: 2
PS C:\> Find-DbaDbGrowthEvent -SqlInstance localhost -UseLocalTime

Returns any database AutoGrow events in the Default Trace with the local time of the instance for every database on the localhost instance.

Example: 3
PS C:\> Find-DbaDbGrowthEvent -SqlInstance ServerA\SQL2016, ServerA\SQL2014

Returns any database AutoGrow events in the Default Traces for every database on ServerA\sql2016 & ServerA\SQL2014.

Example: 4
PS C:\> Find-DbaDbGrowthEvent -SqlInstance ServerA\SQL2016 | Format-Table -AutoSize -Wrap

Returns any database AutoGrow events in the Default Trace for every database on the ServerA\SQL2016 instance in a table format.

Example: 5
PS C:\> Find-DbaDbGrowthEvent -SqlInstance ServerA\SQL2016 -EventType Shrink

Returns any database Auto Shrink events in the Default Trace for every database on the ServerA\SQL2016 instance.

Example: 6
PS C:\> Find-DbaDbGrowthEvent -SqlInstance ServerA\SQL2016 -EventType Growth -FileType Data

Returns any database Auto Growth events on data files in the Default Trace for every database on the ServerA\SQL2016 instance.

Required Parameters

-SqlInstance

The target SQL Server instance or instances. This can be a collection and receive pipeline input to allow the function to be executed against multiple SQL Server instances.

Alias
Required True
Pipeline true (ByValue)
Default Value

Optional Parameters

-SqlCredential

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
-Database

The database(s) to process - this list is auto-populated from the server. If unspecified, all databases will be processed.

Alias
Required False
Pipeline false
Default Value
-ExcludeDatabase

The database(s) to exclude - this list is auto-populated from the server

Alias
Required False
Pipeline false
Default Value
-EventType

Provide a filter on growth event type to filter the results.
Allowed values: Growth, Shrink

Alias
Required False
Pipeline false
Default Value
Accepted Values Growth,Shrink
-FileType

Provide a filter on file type to filter the results.
Allowed values: Data, Log

Alias
Required False
Pipeline false
Default Value
Accepted Values Data,Log
-UseLocalTime

Return the local time of the instance instead of converting to UTC.

Alias
Required False
Pipeline false
Default Value False
-EnableException

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