< Back

Remove-AzureRmSqlDatabaseLongTermRetentionBackup

Tue Jan 29, 2019 10:09 pm

NAME Remove-AzureRmSqlDatabaseLongTermRetentionBackup



SYNOPSIS

Deletes a long term retention backup.





SYNTAX

Remove-AzureRmSqlDatabaseLongTermRetentionBackup [-ServerName] <String> [-DatabaseName] <String> [-BackupName] <String> [-DefaultProfile

<IAzureContextContainer>] [-Force] -Location <String> [-Confirm] [-WhatIf] [<CommonParameters>]



Remove-AzureRmSqlDatabaseLongTermRetentionBackup [-InputObject] <AzureSqlDatabaseLongTermRetentionBackupModel> [-DefaultProfile

<IAzureContextContainer>] [-Force] [-Confirm] [-WhatIf] [<CommonParameters>]



Remove-AzureRmSqlDatabaseLongTermRetentionBackup [-ResourceId] <String> [-DefaultProfile <IAzureContextContainer>] [-Force] [-Confirm] [-WhatIf]

[<CommonParameters>]





DESCRIPTION

The Remove-AzureRmSqlDatabaseLongTermRetentionBackup cmdlet deletes the backup specified.





PARAMETERS

-BackupName <String>

The name of the backup.



Required? true

Position? 3

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-DatabaseName <String>

The name of the Azure SQL Database the backup is from.



Required? true

Position? 2

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-DefaultProfile <IAzureContextContainer>

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



Required? false

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Force [<SwitchParameter>]

Skip confirmation message for performing the action



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-InputObject <AzureSqlDatabaseLongTermRetentionBackupModel>

The Database Long Term Retention Backup object to remove.



Required? true

Position? 0

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Location <String>

The location of the backups' source server.



Required? true

Position? named

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-ResourceId <String>

The Resource ID of the Database Long Term Retention Backup to remove.



Required? true

Position? 0

Default value None

Accept pipeline input? True (ByPropertyName)

Accept wildcard characters? false



-ServerName <String>

The name of the Azure SQL Server the backup is under.



Required? true

Position? 1

Default value None

Accept pipeline input? False

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

Prompts you for confirmation before running the cmdlet.



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

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



Required? false

Position? named

Default value False

Accept pipeline input? False

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).



INPUTS

System.String

Microsoft.Azure.Commands.Sql.Backup.Model.AzureSqlDatabaseLongTermRetentionBackupModel





OUTPUTS

Microsoft.Azure.Commands.Sql.Backup.Model.AzureSqlDatabaseLongTermRetentionBackupModel







NOTES









Example 1: Delete a single backup



PS C:\\> Remove-AzureRmSqlDatabaseLongTermRetentionBackup -Location northeurope -ServerName server01 -DatabaseName database01 -BackupName

"601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000"





BackupExpirationTime : 3/22/2018 5:50:55 AM

BackupName : 601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000

BackupTime : 3/15/2018 5:50:55 AM

DatabaseName : database01

DatabaseDeletionTime :

Location : northeurope

ResourceId : /subscriptions/371edd6d-9630-4558-a7bd-ee139498e6a1/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/s

erver01/longTermRetentionDatabases/database01/longTermRetentionBackups/601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000

ServerName : server01

ServerCreateTime : 2/29/2018 12:12:19 AM



Deletes the backup with name 601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000





Example 2: Delete all backups for a location



PS C:\\> Get-AzureRmSqlDatabaseLongTermRetentionBackup -Location northeurope | Remove-AzureRmSqlDatabaseLongTermRetentionBackup





BackupExpirationTime : 3/22/2018 11:43:18 PM

BackupName : 55970792-164c-4a4a-88e5-7158d092d503;131656309980000000

BackupTime : 3/15/2018 11:43:18 PM

DatabaseName : database02

DatabaseDeletionTime : 3/18/2018 4:36:00 PM

Location : northeurope

ResourceId : /subscriptions/371edd6d-9630-4558-a7bd-ee139498e6a1/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/s

erver02/longTermRetentionDatabases/database02/longTermRetentionBackups/55970792-164c-4a4a-88e5-7158d092d503;131656309980000000

ServerName : server02

ServerCreateTime : 2/28/2018 12:12:19 AM



BackupExpirationTime : 3/22/2018 5:50:55 AM

BackupName : 601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000

BackupTime : 3/15/2018 5:50:55 AM

DatabaseName : database01

DatabaseDeletionTime :

Location : northeurope

ResourceId : /subscriptions/371edd6d-9630-4558-a7bd-ee139498e6a1/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/s

erver01/longTermRetentionDatabases/database01/longTermRetentionBackups/601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000

ServerName : server01

ServerCreateTime : 2/29/2018 12:12:19 AM



This command deletes all long term retention backups for the northeurope location.







RELATED LINKS

Online Version: https://docs.microsoft.com/en-us/powers ... tionbackup

Get-AzureRmSqlDatabaseLongTermRetentionBackup

Get-AzureRmSqlDatabaseBackupLongTermRetentionPolicy

Set-AzureRmSqlDatabaseBackupLongTermRetentionPolicy

SQL Database Documentation https://docs.microsoft.com/azure/sql-database/