Editar

Partilhar via


Get-AzSqlInstanceDatabaseLongTermRetentionBackup

Gets long term retention backup(s).

Syntax

Get-AzSqlInstanceDatabaseLongTermRetentionBackup
   [-Location] <String>
   [-ResourceGroupName <String>]
   [-OnlyLatestPerDatabase]
   [-DatabaseState <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Get-AzSqlInstanceDatabaseLongTermRetentionBackup
   [-Location] <String>
   [-InstanceName] <String>
   [-ResourceGroupName <String>]
   [-OnlyLatestPerDatabase]
   [-DatabaseState <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Get-AzSqlInstanceDatabaseLongTermRetentionBackup
   [-Location] <String>
   [-InstanceName] <String>
   [-DatabaseName] <String>
   [-ResourceGroupName <String>]
   [-OnlyLatestPerDatabase]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Get-AzSqlInstanceDatabaseLongTermRetentionBackup
   [-Location] <String>
   [-InstanceName] <String>
   [-DatabaseName] <String>
   [-BackupName] <String>
   [-ResourceGroupName <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Get-AzSqlInstanceDatabaseLongTermRetentionBackup
   [-Location] <String>
   [-ResourceId] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Get-AzSqlInstanceDatabaseLongTermRetentionBackup
   [-InputObject] <AzureSqlManagedDatabaseModel>
   [-BackupName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
Get-AzSqlInstanceDatabaseLongTermRetentionBackup
   [-InputObject] <AzureSqlManagedDatabaseModel>
   [-OnlyLatestPerDatabase]
   [-DatabaseState <String>]
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The Get-AzSqlInstanceDatabaseLongTermRetentionBackup cmdlet gets long term retention backup(s).

Examples

Example 1

Get-AzSqlInstanceDatabaseLongTermRetentionBackup -Location southeastasia -ResourceGroupName testResourceGroup -InstanceName testInstance -DatabaseName test

BackupExpirationTime : 3/10/2020 1:10:45 PM
BackupName           : 15be823c-7e2c-49d8-819f-a3fdcad92215;132268250550000000
BackupTime           : 2/22/2020 6:04:15 AM
DatabaseName         : test
DatabaseDeletionTime : 2/24/2020 2:56:44 PM
Location             : southeastasia
ResourceId           : /subscriptions/a0a0a0a0-bbbb-cccc-dddd-e1e1e1e1e1e1/resourceGroups/testResourceGroup/providers/Microsoft.Sql/locations/southeastasia/longTermRetentionManaged
                       Instances/testInstance/longTermRetentionDatabases/test/longTermRetentionManagedInstanceBackups/15be823c-7e2c-49d8-819f-a3fdcad92215;132268250550000000
ManagedInstanceName  : testInstance
InstanceCreateTime   : 10/17/2019 4:52:10 PM
ResourceGroupName    : testResourceGroup

Gets all long term retention backups for a particular database. Resource Group is optional.

Parameters

-BackupName

The name of the backup.

Type:String
Position:3
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:True

-Confirm

Prompts you for confirmation before running the cmdlet.

Type:SwitchParameter
Aliases:cf
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-DatabaseName

The name of the Managed Database the backups are under.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-DatabaseState

The state of the database whose backups you want to find, Alive, Deleted, or All. Defaults to All

Type:String
Accepted values:All, Deleted, Live
Position:Named
Default value:None
Required:False
Accept pipeline input:True
Accept wildcard characters:False

-DefaultProfile

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

Type:IAzureContextContainer
Aliases:AzContext, AzureRmContext, AzureCredential
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-InputObject

The database object to get backups for.

Type:AzureSqlManagedDatabaseModel
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-InstanceName

The name of the Managed Instance the backups are under.

Type:String
Position:1
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-Location

The location of the backups' source Managed Instance.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:False
Accept wildcard characters:False

-OnlyLatestPerDatabase

Whether or not to only get the latest backup per database. Defaults to false.

Type:SwitchParameter
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceGroupName

The name of the resource group.

Type:String
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ResourceId

The database Resource ID to get backups for.

Type:String
Position:0
Default value:None
Required:True
Accept pipeline input:True
Accept wildcard characters:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type:SwitchParameter
Aliases:wi
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

Inputs

AzureSqlManagedDatabaseModel

String

Outputs

AzureSqlManagedDatabaseLongTermRetentionBackupModel