Edit

Share via


Get-AzSqlDatabaseBackupShortTermRetentionPolicy

Gets a backup short term retention policy.

Syntax

PolicyByResourceServerDatabaseSet (Default)

Get-AzSqlDatabaseBackupShortTermRetentionPolicy
    [-ResourceGroupName] <String>
    [-ServerName] <String>
    [-DatabaseName] <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

PolicyByInputObjectSet

Get-AzSqlDatabaseBackupShortTermRetentionPolicy
    -AzureSqlDatabaseObject <AzureSqlDatabaseModel>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

PolicyByResourceIdSet

Get-AzSqlDatabaseBackupShortTermRetentionPolicy
    -ResourceId <String>
    [-DefaultProfile <IAzureContextContainer>]
    [<CommonParameters>]

Description

The Get-AzSqlDatabaseBackupShortTermRetentionPolicy cmdlet gets the short term retention policy registered to this database. The policy is the retention period in days and differential backup interval in hours, for point-in-time restore backups.

Examples

Example 1

Get-AzSqlDatabaseBackupShortTermRetentionPolicy -ResourceGroupName resourcegroup01 -ServerName server01 -DatabaseName database01
ResourceGroupName ServerName  DatabaseName RetentionDays DiffBackupIntervalInHours
----------------- ----------  ------------ ------------- -------------------------
resourcegroup01   server01    database01   7             24

This command gets the short term retention policy for database01.

Example 2

Get-AzSqlDatabase -ResourceGroupName resourcegroup01 -ServerName server01 -DatabaseName database01 | Get-AzSqlDatabaseBackupShortTermRetentionPolicy
ResourceGroupName ServerName  DatabaseName RetentionDays DiffBackupIntervalInHours
----------------- ----------  ------------ ------------- -------------------------
resourcegroup01   server01    database01   7             24

This command gets the short term retention policy for database01 via piping in a database object.

Parameters

-AzureSqlDatabaseObject

The database object to get the policy for.

Parameter properties

Type:AzureSqlDatabaseModel
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzureSqlDatabase

Parameter sets

PolicyByInputObjectSet
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-DatabaseName

The name of the Azure SQL Database to use.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PolicyByResourceServerDatabaseSet
Position:2
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-DefaultProfile

The credentials, account, tenant, and subscription used for communication with Azure.

Parameter properties

Type:IAzureContextContainer
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzContext, AzureRmContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ResourceGroupName

The name of the resource group.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PolicyByResourceServerDatabaseSet
Position:0
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ResourceId

The short term retention policy resource Id.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PolicyByResourceIdSet
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

-ServerName

The name of the Azure SQL Server the database is in.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

PolicyByResourceServerDatabaseSet
Position:1
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:True
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

AzureSqlDatabaseModel

String

Outputs

AzureSqlDatabaseBackupShortTermRetentionPolicyModel