你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn

Add-AzSqlElasticJobTarget

将目标添加到目标组

语法

SqlDatabase (默认值)

Add-AzSqlElasticJobTarget
    [-ResourceGroupName] <String>
    [-AgentServerName] <String>
    [-AgentName] <String>
    [-TargetGroupName] <String>
    -ServerName <String>
    -DatabaseName <String>
    [-Exclude]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SqlServerOrElasticPool

Add-AzSqlElasticJobTarget
    [-ResourceGroupName] <String>
    [-AgentServerName] <String>
    [-AgentName] <String>
    [-TargetGroupName] <String>
    -ServerName <String>
    [-Exclude]
    [-ElasticPoolName <String>]
    [-RefreshCredentialName <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SqlShardMap

Add-AzSqlElasticJobTarget
    [-ResourceGroupName] <String>
    [-AgentServerName] <String>
    [-AgentName] <String>
    [-TargetGroupName] <String>
    -ServerName <String>
    -ShardMapName <String>
    -DatabaseName <String>
    [-Exclude]
    [-RefreshCredentialName <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SqlDatabaseUsingParentObject

Add-AzSqlElasticJobTarget
    [-ParentObject] <AzureSqlElasticJobTargetGroupModel>
    -ServerName <String>
    -DatabaseName <String>
    [-Exclude]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SqlServerOrElasticPoolUsingParentObject

Add-AzSqlElasticJobTarget
    [-ParentObject] <AzureSqlElasticJobTargetGroupModel>
    -ServerName <String>
    [-Exclude]
    [-ElasticPoolName <String>]
    [-RefreshCredentialName <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SqlShardMapUsingParentObject

Add-AzSqlElasticJobTarget
    [-ParentObject] <AzureSqlElasticJobTargetGroupModel>
    -ServerName <String>
    -ShardMapName <String>
    -DatabaseName <String>
    [-Exclude]
    [-RefreshCredentialName <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SqlDatabaseUsingParentResourceId

Add-AzSqlElasticJobTarget
    [-ParentResourceId] <String>
    -ServerName <String>
    -DatabaseName <String>
    [-Exclude]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SqlServerOrElasticPoolUsingParentResourceId

Add-AzSqlElasticJobTarget
    [-ParentResourceId] <String>
    -ServerName <String>
    [-Exclude]
    [-ElasticPoolName <String>]
    [-RefreshCredentialName <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SqlShardMapUsingParentResourceId

Add-AzSqlElasticJobTarget
    [-ParentResourceId] <String>
    -ServerName <String>
    -ShardMapName <String>
    -DatabaseName <String>
    [-Exclude]
    [-RefreshCredentialName <String>]
    [-DefaultProfile <IAzureContextContainer>]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

说明

Add-AzSqlElasticJobTarget cmdlet 将目标资源添加到目标组

示例

示例 1:添加服务器目标

$tg = Get-AzSqlElasticJobTargetGroup -ResourceGroupName rg -ServerName elasticjobserver -Name tg1
$tg | Add-AzSqlElasticJobTarget -ServerName s1 -RefreshCredentialName cred1
TargetGroupName TargetType TargetServerName TargetDatabaseName TargetElasticPoolName TargetShardMapName RefreshCredentialName MembershipType
--------------- ---------- ---------------- ------------------ --------------------- ------------------ --------------------- --------------
tg1             SqlServer  s1                                                                           cred1                 Include

示例 2:添加数据库目标

$tg = Get-AzSqlElasticJobTargetGroup -ResourceGroupName rg -ServerName elasticjobserver -Name tg1
$tg | Add-AzSqlElasticJobTarget -ServerName s1 -DatabaseName db2
TargetGroupName TargetType  TargetServerName TargetDatabaseName TargetElasticPoolName TargetShardMapName RefreshCredentialName MembershipType
--------------- ----------  ---------------- ------------------ --------------------- ------------------ --------------------- --------------
tg1             SqlDatabase s1               db2                                                                               Include

示例 3:添加弹性池目标

$tg | Add-AzSqlElasticJobTarget -ServerName s1 -ElasticPoolName ep1 -RefreshCredentialName cred1
TargetGroupName TargetType     TargetServerName TargetDatabaseName TargetElasticPoolName TargetShardMapName RefreshCredentialName MembershipType
--------------- ----------     ---------------- ------------------ --------------------- ------------------ --------------------- --------------
tg1             SqlElasticPool s1                                  ep1                                      cred1                 Include

示例 4:添加分片映射目标

$tg = Get-AzSqlElasticJobTargetGroup -ResourceGroupName rg -ServerName elasticjobserver -Name tg1
$tg | Add-AzSqlElasticJobTarget -ServerName s1 -ShardMapName sm1 -DatabaseName db1 -RefreshCredentialName cred1
TargetGroupName TargetType  TargetServerName TargetDatabaseName TargetElasticPoolName TargetShardMapName RefreshCredentialName MembershipType
--------------- ----------  ---------------- ------------------ --------------------- ------------------ --------------------- --------------
tg1             SqlShardMap s1               db1                                      sm1                cred1                 Include

将目标(服务器、弹性池、数据库和分片映射)添加到目标组

参数

-AgentName

代理名称。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

SqlDatabase
Position:2
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlServerOrElasticPool
Position:2
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlShardMap
Position:2
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-AgentServerName

服务器名称

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

SqlDatabase
Position:1
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlServerOrElasticPool
Position:1
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlShardMap
Position:1
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-Confirm

在运行 cmdlet 之前,提示你进行确认。

参数属性

类型:SwitchParameter
默认值:False
支持通配符:False
不显示:False
别名:cf

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-DatabaseName

数据库目标名称

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

SqlDatabase
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlShardMap
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlDatabaseUsingParentObject
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlShardMapUsingParentObject
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlDatabaseUsingParentResourceId
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlShardMapUsingParentResourceId
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-DefaultProfile

用于与 Azure 通信的凭据、帐户、租户和订阅。

参数属性

类型:IAzureContextContainer
默认值:None
支持通配符:False
不显示:False
别名:AzContext, AzureRmContext, AzureCredential

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ElasticPoolName

弹性池目标名称

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

SqlServerOrElasticPool
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlServerOrElasticPoolUsingParentObject
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlServerOrElasticPoolUsingParentResourceId
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-Exclude

排除目标。

参数属性

类型:SwitchParameter
默认值:False
支持通配符:False
不显示:False

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ParentObject

目标组对象。

参数属性

类型:AzureSqlElasticJobTargetGroupModel
默认值:None
支持通配符:False
不显示:False

参数集

SqlDatabaseUsingParentObject
Position:0
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlServerOrElasticPoolUsingParentObject
Position:0
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlShardMapUsingParentObject
Position:0
必需:True
来自管道的值:True
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ParentResourceId

目标组资源 ID。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

SqlDatabaseUsingParentResourceId
Position:0
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlServerOrElasticPoolUsingParentResourceId
Position:0
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlShardMapUsingParentResourceId
Position:0
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-RefreshCredentialName

刷新凭据名称

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

SqlServerOrElasticPool
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlShardMap
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlServerOrElasticPoolUsingParentObject
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlShardMapUsingParentObject
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlServerOrElasticPoolUsingParentResourceId
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlShardMapUsingParentResourceId
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ResourceGroupName

资源组名称

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

SqlDatabase
Position:0
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlServerOrElasticPool
Position:0
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlShardMap
Position:0
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-ServerName

服务器目标名称

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

SqlDatabase
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlShardMap
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlDatabaseUsingParentObject
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlServerOrElasticPoolUsingParentObject
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlShardMapUsingParentObject
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlDatabaseUsingParentResourceId
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlServerOrElasticPoolUsingParentResourceId
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlShardMapUsingParentResourceId
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-ShardMapName

分片映射目标名称

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

SqlShardMap
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlShardMapUsingParentObject
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False
SqlShardMapUsingParentResourceId
Position:Named
必需:True
来自管道的值:False
来自管道的值(按属性名称):True
来自剩余参数的值:False

-TargetGroupName

目标组名称。

参数属性

类型:String
默认值:None
支持通配符:False
不显示:False

参数集

SqlDatabase
Position:3
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlServerOrElasticPool
Position:3
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False
SqlShardMap
Position:3
必需:True
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

-WhatIf

显示 cmdlet 运行时会发生什么情况。 命令脚本未运行。

参数属性

类型:SwitchParameter
默认值:False
支持通配符:False
不显示:False
别名:无线

参数集

(All)
Position:Named
必需:False
来自管道的值:False
来自管道的值(按属性名称):False
来自剩余参数的值:False

CommonParameters

此 cmdlet 支持通用参数:-Debug、-ErrorAction、-ErrorVariable、-InformationAction、-InformationVariable、-OutBuffer、-OutVariable、-PipelineVariable、-ProgressAction、-Verbose、-WarningAction 和 -WarningVariable。 有关详细信息,请参阅 about_CommonParameters

输入

AzureSqlElasticJobTargetGroupModel

输出

JobTarget