編輯

共用方式為


Copy-AzSqlDatabaseLongTermRetentionBackup

Copies a long term retention backup to a target database.

Syntax

Copy-AzSqlDatabaseLongTermRetentionBackup
    [-Location] <String>
    [-ServerName] <String>
    [-DatabaseName] <String>
    [-BackupName] <String>
    [-ResourceGroupName <String>]
    -TargetDatabaseName <String>
    [-TargetServerFullyQualifiedDomainName <String>]
    [-TargetServerName <String>]
    -TargetSubscriptionId <String>
    -TargetResourceGroupName <String>
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Copy-AzSqlDatabaseLongTermRetentionBackup
    [-ResourceId] <String>
    -TargetDatabaseName <String>
    [-TargetServerFullyQualifiedDomainName <String>]
    [-TargetServerName <String>]
    -TargetSubscriptionId <String>
    -TargetResourceGroupName <String>
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]
Copy-AzSqlDatabaseLongTermRetentionBackup
    [-InputObject] <AzureSqlDatabaseLongTermRetentionBackupModel>
    -TargetDatabaseName <String>
    [-TargetServerFullyQualifiedDomainName <String>]
    [-TargetServerName <String>]
    -TargetSubscriptionId <String>
    -TargetResourceGroupName <String>
    [-AsJob]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Copies a long term retention backup to a target database. Target database may be in different cluster than backup source.

Examples

Example 1: Copy a long term retention backup to another server within the same environment.

Copy-AzSqlDatabaseLongTermRetentionBackup -Location southeastasia -ServerName test-server -DatabaseName test-database -BackupName 'e5c20f43-494c-4925-89d1-58e0f4569fb3;132579992320000000' -ResourceGroupName testrg -TargetDatabaseName ltr1 -TargetServerName ayang-eas -TargetSubscriptionId '01c4ec88-e179-44f7-9eb0-e9719a5087ab' -TargetResourceGroupName testrg

SourceResourceGroupName              : test-rg
SourceLocation                       : southeastasia
SourceServerName                     : test-server
SourceDatabaseName                   : test-database
SourceBackupName                     : e5c20f43-494c-4925-89d1-58e0f4569fb3;132579992320000000
SourceBackupResourceId               : /subscriptions/01c4ec88-e179-44f7-9eb0-e9719a5087ab/resourceGroups/test-rg/providers/Microsoft.Sql/locations/SoutheastAsia/longTermRetentionServers/test-server/longTermRetentionDatabases/test-database/longTermRetentionBackups/e5c20f43-494c-4925-89d1-58e0f4569fb3;132579992320000000
SourceBackupStorageRedundancy        : Geo
TargetSubscriptionId                 : 01c4ec88-e179-44f7-9eb0-e9719a5087ab
TargetResourceGroupName              : test-rg
TargetLocation                       : East Asia
TargetServerName                     : ayang-eas
TargetServerFullyQualifiedDomainName :
TargetServerResourceId               : /subscriptions/01c4ec88-e179-44f7-9eb0-e9719a5087ab/resourceGroups/test-rg/providers/Microsoft.Sql/servers/ayang-eas
TargetDatabaseName                   : ltr1
TargetBackupName                     : 70554a1f-ae6e-479e-99b1-50ea320654eb;132579992320000000
TargetBackupResourceId               : /subscriptions/01c4ec88-e179-44f7-9eb0-e9719a5087ab/resourceGroups/test-rg/providers/Microsoft.Sql/locations/East Asia/longTermRetentionServers/ayang-eas/longTermRetentionDatabases/ltr1/longTermRetentionBackups/70554a1f-ae6e-479e-99b1-50ea320654eb;132579992320000000

This copies a long term retention backup from a source database in Southeast Asia to a target database in East Asia.

Parameters

-AsJob

Run cmdlet in the background

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

-BackupName

The name of the backup.

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

-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 Azure SQL Database the backup is from.

Type:String
Position:2
Default value:None
Required:True
Accept pipeline input:False
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 Long Term Retention Backup object to remove.

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

-Location

The location of the backups' source server.

Type:String
Position:0
Default value:None
Required:True
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 Resource ID of the Database Long Term Retention Backup to remove.

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

-ServerName

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

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

-TargetDatabaseName

The name of the target database.

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

-TargetResourceGroupName

The resource ID of the target subscription.

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

-TargetServerFullyQualifiedDomainName

The fully qualified domain name of the target server.

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

-TargetServerName

The name of the target server.

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

-TargetSubscriptionId

The resource ID of the target subscription.

Type:String
Position:Named
Default value:None
Required:True
Accept pipeline input:False
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

String

AzureSqlDatabaseLongTermRetentionBackupModel

Outputs

AzureSqlDatabaseLongTermRetentionBackupModel