Editar

Compartir a través de


New-AzSqlDatabaseCopy

Creates a copy of a SQL Database that uses the snapshot at the current time.

Syntax

New-AzSqlDatabaseCopy
   [-DatabaseName] <String>
   [-ServiceObjectiveName <String>]
   [-ElasticPoolName <String>]
   [-Tags <Hashtable>]
   [-CopyResourceGroupName <String>]
   [-CopyServerName <String>]
   -CopyDatabaseName <String>
   [-AsJob]
   [-LicenseType <String>]
   [-BackupStorageRedundancy <String>]
   [-ZoneRedundant]
   [-AssignIdentity]
   [-EncryptionProtector <String>]
   [-UserAssignedIdentityId <String[]>]
   [-KeyList <String[]>]
   [-FederatedClientId <Guid>]
   [-EncryptionProtectorAutoRotation]
   [-ServerName] <String>
   [-ResourceGroupName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]
New-AzSqlDatabaseCopy
   [-DatabaseName] <String>
   [-Tags <Hashtable>]
   [-CopyResourceGroupName <String>]
   [-CopyServerName <String>]
   -CopyDatabaseName <String>
   [-AsJob]
   -ComputeGeneration <String>
   -VCore <Int32>
   [-LicenseType <String>]
   [-BackupStorageRedundancy <String>]
   [-ZoneRedundant]
   [-AssignIdentity]
   [-EncryptionProtector <String>]
   [-UserAssignedIdentityId <String[]>]
   [-KeyList <String[]>]
   [-FederatedClientId <Guid>]
   [-EncryptionProtectorAutoRotation]
   [-ServerName] <String>
   [-ResourceGroupName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [-WhatIf]
   [-Confirm]
   [<CommonParameters>]

Description

The New-AzSqlDatabaseCopy cmdlet creates a copy of an Azure SQL Database that uses the snapshot of the data at the current time. Use this cmdlet instead of the Start-AzSqlDatabaseCopy cmdlet to create a one-time database copy. This cmdlet returns the Database object of the copy. Note: Use the New-AzSqlDatabaseSecondary cmdlet to configure geo-replication for a database. This cmdlet is also supported by the SQL Server Stretch Database service on Azure.

Examples

Example 1

Creates a copy of a SQL Database that uses the snapshot at the current time. (autogenerated)

New-AzSqlDatabaseCopy -CopyDatabaseName <String> -CopyResourceGroupName <String> -CopyServerName <String> -DatabaseName db1 -ResourceGroupName MyResourceGroup -ServerName s1

Example 2

Creates a copy of a SQL Database that uses the snapshot at the current time. (autogenerated)

New-AzSqlDatabaseCopy -CopyDatabaseName <String> -CopyResourceGroupName <String> -CopyServerName <String> -DatabaseName db1 -ResourceGroupName MyResourceGroup -ServerName s1 -ServiceObjectiveName 'S1'

Parameters

-AsJob

Run cmdlet in the background

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

-AssignIdentity

Generate and assign a Microsoft Entra identity for this database for use with key management services like Azure KeyVault.

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

-BackupStorageRedundancy

The Backup storage redundancy used to store backups for the SQL Database. Options are: Local, Zone and Geo.

Type:String
Accepted values:Local, Zone, Geo, GeoZone
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ComputeGeneration

The compute generation to assign to the new copy.

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

-Confirm

Prompts you for confirmation before running the cmdlet.

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

-CopyDatabaseName

Specifies the name of the SQL Database copy.

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

-CopyResourceGroupName

Specifies the name of the Azure Resource Group in which to assign the copy.

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

-CopyServerName

Specifies the name of the SQL Server which hosts the copy.

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

-DatabaseName

Specifies the name of the SQL Database to copy.

Type:String
Position:2
Default value:None
Required:True
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

-ElasticPoolName

Specifies the name of the elastic pool in which to assign the copy.

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

-EncryptionProtector

The encryption protector key for SQL Database copy.

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

-EncryptionProtectorAutoRotation

The AKV Key Auto Rotation status

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

-FederatedClientId

The federated client id for the SQL Database. It is used for cross tenant CMK scenario.

Type:Nullable<T>[Guid]
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-KeyList

The list of AKV keys for the SQL Database copy.

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

-LicenseType

The license type for the Azure Sql database.

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

-ResourceGroupName

Specifies the name of the Resource Group that contains the database to copy.

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

-ServerName

Specifies the name of the SQL Server that contains the database to copy.

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

-ServiceObjectiveName

Specifies the name of the service objective to assign to the copy.

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

-Tags

Specifies the Key-value pairs in the form of a hash table to associate with the Azure SQL Database copy. For example: @{key0="value0";key1=$null;key2="value2"}

Type:Hashtable
Aliases:Tag
Position:Named
Default value:None
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-UserAssignedIdentityId

The list of user assigned identity for the SQL Database copy.

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

-VCore

The Vcore numbers of the Azure Sql Database copy.

Type:Int32
Aliases:Capacity
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:False
Required:False
Accept pipeline input:False
Accept wildcard characters:False

-ZoneRedundant

The zone redundancy to associate with the Azure Sql Database. This property is only settable for Hyperscale edition databases.

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

Inputs

String

Outputs

AzureSqlDatabaseCopyModel