commands

^

Measure-DbaBackupThroughput

Author Chrissy LeMaire (@cl), netnerds.net
Availability Windows, Linux, macOS

 

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

Synopsis

Determines how quickly SQL Server is backing up databases to media.

Description

Returns backup history details for one or more databases on a SQL Server.

Output looks like this: SqlInstance : sql2016 Database : SharePoint_Config AvgThroughput : 1.07 MB AvgSize : 24.17 AvgDuration : 00:00:01.1000000 MinThroughput : 0.02 MB MaxThroughput : 2.26 MB MinBackupDate : 8/6/2015 10:22:01 PM MaxBackupDate : 6/19/2016 12:57:45 PM BackupCount : 10

Syntax

Measure-DbaBackupThroughput
    [-SqlInstance] <DbaInstanceParameter[]>
    [[-SqlCredential] <PSCredential>]
    [[-Database] <Object[]>]
    [[-ExcludeDatabase] <Object[]>]
    [[-Since] <DateTime>]
    [-Last]
    [[-Type] <String>]
    [[-DeviceType] <String[]>]
    [-EnableException]
    [<CommonParameters>]

 

Examples

 

Example: 1
PS C:\> Measure-DbaBackupThroughput -SqlInstance sql2016

Parses every backup in msdb's backuphistory for stats on all databases.

Example: 2
PS C:\> Measure-DbaBackupThroughput -SqlInstance sql2016 -Database AdventureWorks2014

Parses every backup in msdb's backuphistory for stats on AdventureWorks2014.

Example: 3
PS C:\> Measure-DbaBackupThroughput -SqlInstance sql2005 -Last

Processes the last full, diff and log backups every backup for all databases on sql2005.

Example: 4
PS C:\> Measure-DbaBackupThroughput -SqlInstance sql2005 -Last -Type Log

Processes the last log backups every backup for all databases on sql2005.

Example: 5
PS C:\> Measure-DbaBackupThroughput -SqlInstance sql2016 -Since (Get-Date).AddDays(-7) | Where-Object { $_.MinThroughput.Gigabyte -gt 1 }

Gets backup calculations for the last week and filters results that have a minimum of 1GB throughput

Example: 6
PS C:\> Measure-DbaBackupThroughput -SqlInstance sql2016 -Since (Get-Date).AddDays(-365) -Database bigoldb

Gets backup calculations, limited to the last year and only the bigoldb database

Required Parameters

-SqlInstance

The target SQL Server instance or 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. Options for this list are 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. Options for this list are auto-populated from the server.

Alias
Required False
Pipeline false
Default Value
-Since

All backups taken on or after the point in time represented by this datetime object will be processed.

Alias
Required False
Pipeline false
Default Value
-Last

If this switch is enabled, only the last backup will be measured.

Alias
Required False
Pipeline false
Default Value False
-Type

By default, this command measures the speed of Full backups. Valid options are "Full", "Log" and "Differential".

Alias
Required False
Pipeline false
Default Value Full
Accepted Values Full,Log,Differential,File,Differential File,Partial Full,Partial Differential
-DeviceType

Specifies one or more DeviceTypes to use in filtering backup sets. Valid values are "Disk", "Permanent Disk Device", "Tape", "Permanent Tape Device", "Pipe", "Permanent Pipe Device" and "Virtual Device", as well as custom integers for your own DeviceTypes.

Alias
Required False
Pipeline false
Default Value
-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