Get-AzSqlDatabaseLongTermRetentionBackup
Syntax
Get-AzSqlDatabaseLongTermRetentionBackup
[-Location] <String>
[[-ResourceGroupName] <String>]
[-OnlyLatestPerDatabase]
[-DatabaseState <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Get-AzSqlDatabaseLongTermRetentionBackup
[-Location] <String>
[-ServerName] <String>
[-DatabaseName <String>]
[[-ResourceGroupName] <String>]
[-OnlyLatestPerDatabase]
[-DatabaseState <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Get-AzSqlDatabaseLongTermRetentionBackup
[-Location] <String>
[-ServerName] <String>
-DatabaseName <String>
[-BackupName] <String>
[[-ResourceGroupName] <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Get-AzSqlDatabaseLongTermRetentionBackup
[-Location] <String>
[-ResourceId] <String>
[-BackupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Get-AzSqlDatabaseLongTermRetentionBackup
[-Location] <String>
[-ResourceId] <String>
[-OnlyLatestPerDatabase]
[-DatabaseState <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Get-AzSqlDatabaseLongTermRetentionBackup
[-InputObject] <AzureSqlDatabaseModel>
[-BackupName] <String>
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Get-AzSqlDatabaseLongTermRetentionBackup
[-InputObject] <AzureSqlDatabaseModel>
[-OnlyLatestPerDatabase]
[-DatabaseState <String>]
[-DefaultProfile <IAzureContextContainer>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Description
The Get-AzSqlDatabaseLongTermRetentionBackup cmdlet gets all long term retention backups for a location, server, or database or gets a specific long term retention backup.
Examples
Example 1: Get all backups for a location
PS C:\> Get-AzSqlDatabaseLongTermRetentionBackup -Location northeurope
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/resourceGroups/resourcegroup01/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/server01/longTermRetentionDatabases/database01/longTermRetentionBackups/601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
ServerName : server01
ServerCreateTime : 2/29/2018 12:12:19 AM
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/server02/longTermRetentionDatabases/database02/longTermRetentionBackups/55970792-164c-4a4a-88e5-7158d092d503;131656309980000000
ServerName : server02
ServerCreateTime : 2/28/2018 12:12:19 AM
This command gets all long term retention backups for all databases (which may be alive or deleted) in northeurope, resource group will be set only if server is live.
Example 2: Get all backups for a location under a resource group
PS C:\> Get-AzSqlDatabaseLongTermRetentionBackup -Location northeurope -ResourceGroup resourceGroup01
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/resourceGroups/resourcegroup01/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/server01/longTermRetentionDatabases/database01/longTermRetentionBackups/601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
ServerName : server01
ServerCreateTime : 2/29/2018 12:12:19 AM
This command gets all long term retention backups for all databases (which may be alive or deleted) under a resource group in northeurope.
Example 3: Get a specific long term retention backup
PS C:\> Get-AzSqlDatabaseLongTermRetentionBackup -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/resourceGroups/resourcegroup01/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/server01/longTermRetentionDatabases/database01/longTermRetentionBackups/601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
ServerName : server01
ServerCreateTime : 2/29/2018 12:12:19 AM
This command gets the backup with name 601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
Example 4: Get all long term retention backups for a database
PS C:\> Get-AzSqlDatabase -ResourceGroupName resourcegroup01 -ServerName server01 -DatabaseName database01 | Get-AzSqlDatabaseLongTermRetentionBackup
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/resourceGroups/resourcegroup01/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/server01/longTermRetentionDatabases/database01/longTermRetentionBackups/601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
ServerName : server01
ServerCreateTime : 2/29/2018 12:12:19 AM
This command gets all long term retention backups for database01
Example 5: Get long term retention backups using filtering
PS C:\> Get-AzSqlDatabaseLongTermRetentionBackup -Location northeurope -ServerName server01 -DatabaseName database01 -BackupName "601061b7*"
BackupExpirationTime : 3/22/2018 11:43:18 PM
BackupName : 601061b7-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/resourceGroups/resourcegroup01/Microsoft.Sql/locations/northeurope/longTermRetentionServers/server01/longTermRetentionDatabases/database02/longTermRetentionBackups/601061b7-164c-4a4a-88e5-7158d092d503;131656309980000000
ServerName : server01
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/resourceGroups/resourcegroup01/providers/Microsoft.Sql/locations/northeurope/longTermRetentionServers/server01/longTermRetentionDatabases/database01/longTermRetentionBackups/601061b7-d10b-46e0-bf77-a2bfb16a6add;131655666550000000
ServerName : server01
ServerCreateTime : 2/29/2018 12:12:19 AM
This command gets all backups with name that starts with "601061b7"
Parameters
The name of the backup.
Type: | String |
Position: | 3 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
Prompts you for confirmation before running the cmdlet.
Type: | SwitchParameter |
Aliases: | cf |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The name of the Azure SQL Database the backup is from.
Type: | String |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
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 |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
The credentials, account, tenant, and subscription used for communication with Azure.
Type: | Microsoft.Azure.Commands.Common.Authentication.Abstractions.Core.IAzureContextContainer |
Aliases: | AzContext, AzureRmContext, AzureCredential |
Position: | Named |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The database object to get backups for.
Type: | AzureSqlDatabaseModel |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True (ByValue) |
Accept wildcard characters: | False |
The location of the backups' source server.
Type: | String |
Position: | 0 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Whether or not to only get the latest backup per database. Defaults to false.
Type: | SwitchParameter |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The name of the resource group.
Type: | String |
Position: | 0 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
The database Resource ID to get backups for.
Type: | String |
Position: | 0 |
Default value: | None |
Accept pipeline input: | True (ByPropertyName) |
Accept wildcard characters: | False |
The name of the Azure SQL Server the backups are under.
Type: | String |
Position: | 1 |
Default value: | None |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Shows what would happen if the cmdlet runs. The cmdlet is not run.
Type: | SwitchParameter |
Aliases: | wi |
Position: | Named |
Default value: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
Inputs
Outputs
AzureSqlDatabaseLongTermRetentionBackupModel