共用方式為


New-AzDataMigrationSelectedDBObject

建立資料庫輸入物件,其中包含來源和目標資料庫的相關信息以進行移轉。

語法

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

New-AzDataMigrationSelectedDB Cmdlet 會建立資料庫信息物件,其中包含來源和目標資料庫的相關信息,以及移轉的數據表對應。 此 Cmdlet 可以做為參數搭配 New-AzDataMigrationTask Cmdlet。

範例

範例 1

New-AzDataMigrationSelectedDBObject -MigrateSqlServerSqlDb -Name "HR" -TargetDatabaseName "HR_PSTEST" -TableMap $tableMap

Name TargetDatabaseName MakeSourceDbReadOnly TableMap
---- ------------------ -------------------- --------
HR   HR_PSTEST                         False {[HR.COUNTRIES, HR.COUNTRIES]}

範例 2

New-AzDataMigrationSelectedDBObject -MigrateSqlServerSqlDbMi -Name "HR" -TargetDatabaseName "HR_PSTEST" -BackupFileShare $backupFileShare

Name RestoreDatabaseName BackupFileShare
---- ------------------- ---------------
HR   HRTest              Microsoft.Azure.Management.DataMigration.Models.FileShare

參數

-BackupFileShare

應該備份此資料庫的源伺服器資料庫檔案的檔案共用。 使用此設定來覆寫每個資料庫的檔案共享資訊。 使用伺服器的完整功能變數名稱。

類型:FileShare
Position:Named
預設值:None
必要:False
接受管線輸入:True
接受萬用字元:False

-DefaultProfile

用於與 Azure 通訊的認證、帳戶、租用戶和訂用帳戶。

類型:IAzureContextContainer
別名:AzContext, AzureRmContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-MakeSourceDbReadOnly

在移轉之前將資料庫設定為唯讀

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-MigrateSqlServerSqlDb

將移轉類型設定為 SQL Server 至 SQL DB 移轉。

類型:SwitchParameter
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-MigrateSqlServerSqlDbMi

將移轉類型設定為 SQL Server 至 SQL DB MI 移轉。

類型:SwitchParameter
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-SourceDatabaseName

源資料庫的名稱。

類型:String
別名:Name
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-TableMap

來源與目標數據表的對應

類型:IDictionary<TKey,TValue>[System.String,System.String]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-TargetDatabaseName

目標資料庫的名稱。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

輸入

輸出