你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
New-AzDataMigrationSelectedDBObject
Creates a database input object that contains information about source and target databases for migration.
Syntax
New-AzDataMigrationSelectedDBObject
-SourceDatabaseName <String>
-TargetDatabaseName <String>
[-MigrateSqlServerSqlDb]
[-MakeSourceDbReadOnly]
[-TableMap <System.Collections.Generic.IDictionary`2[System.String,System.String]>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
New-AzDataMigrationSelectedDBObject
-SourceDatabaseName <String>
-TargetDatabaseName <String>
[-MigrateSqlServerSqlDbMi]
[-BackupFileShare <FileShare>]
[-DefaultProfile <IAzureContextContainer>]
[<CommonParameters>]
Description
The New-AzDataMigrationSelectedDB cmdlet creates a database info object that contains information about source and target databases, as well as the table mappings, for migration. This cmdlet can be used as a parameter with the New-AzDataMigrationTask cmdlet.
Examples
Example 1
New-AzDataMigrationSelectedDBObject -MigrateSqlServerSqlDb -Name "HR" -TargetDatabaseName "HR_PSTEST" -TableMap $tableMap
Name TargetDatabaseName MakeSourceDbReadOnly TableMap
---- ------------------ -------------------- --------
HR HR_PSTEST False {[HR.COUNTRIES, HR.COUNTRIES]}
Example 2
New-AzDataMigrationSelectedDBObject -MigrateSqlServerSqlDbMi -Name "HR" -TargetDatabaseName "HR_PSTEST" -BackupFileShare $backupFileShare
Name RestoreDatabaseName BackupFileShare
---- ------------------- ---------------
HR HRTest Microsoft.Azure.Management.DataMigration.Models.FileShare
Parameters
-BackupFileShare
File share where the source server database files for this database should be backed up. Use this setting to override file share information for each database. Use fully qualified domain name for the server.
Type: | FileShare |
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 |
-MakeSourceDbReadOnly
Set Database to readonly before migration
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | False |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MigrateSqlServerSqlDb
Set migration type to SQL Server to SQL DB Migration.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-MigrateSqlServerSqlDbMi
Set migration type to SQL Server to SQL DB MI Migration.
Type: | SwitchParameter |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-SourceDatabaseName
The name of the source database.
Type: | String |
Aliases: | Name |
Position: | Named |
Default value: | None |
Required: | True |
Accept pipeline input: | False |
Accept wildcard characters: | False |
-TableMap
mapping of source to target tables
Type: | IDictionary<TKey,TValue>[System.String,System.String] |
Position: | Named |
Default value: | None |
Required: | False |
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 |