다음을 통해 공유


Add-AzureRmSqlDatabaseToFailoverGroup

하나 이상의 데이터베이스를 Azure SQL Database 장애 조치(failover) 그룹에 추가합니다.

Warning

AzureRM PowerShell 모듈은 2024년 2월 29일부터 공식적으로 사용되지 않습니다. 사용자는 지속적인 지원 및 업데이트를 보장하기 위해 AzureRM에서 Az PowerShell 모듈로 마이그레이션하는 것이 좋습니다.

AzureRM 모듈은 여전히 작동할 수 있지만 더 이상 기본 또는 지원되지 않으므로 사용자의 재량에 따라 계속 사용할 수 있습니다. Az 모듈로 전환하는 방법에 대한 지침은 마이그레이션 리소스를 참조하세요.

구문

Add-AzureRmSqlDatabaseToFailoverGroup
   [-ServerName] <String>
   [-FailoverGroupName] <String>
   -Database <System.Collections.Generic.List`1[Microsoft.Azure.Commands.Sql.Database.Model.AzureSqlDatabaseModel]>
   [-ResourceGroupName] <String>
   [-DefaultProfile <IAzureContextContainer>]
   [<CommonParameters>]

Description

Azure SQL Database 장애 조치(failover) 그룹의 주 서버에 있는 하나 이상의 데이터베이스를 해당 장애 조치(failover) 그룹에 추가합니다. 데이터베이스는 기존 복제본(replica) 관계 내의 보조 데이터베이스가 아니어야 합니다. 이 명령은 장애 조치(failover) 그룹의 보조 서버에 추가된 모든 데이터베이스의 지역 복제본(replica)tion을 시작합니다. '-Database' 매개 변수를 채울 데이터베이스 개체를 가져오려면 Get-AzureRmSqlDatabase cmdlet(예: Get-AzureRmSqlDatabase cmdlet)을 사용합니다. 장애 조치(failover) 그룹의 주 서버를 사용하여 명령을 실행해야 합니다.

예제

예 1

PS C:\> $failoverGroup = Get-AzureRmSqlDatabase -ResourceGroupName rg -ServerName primaryserver -DatabaseName db1 | Add-AzureRmSqlDatabaseToFailoverGroup -ResourceGroupName rg -ServerName primaryserver -FailoverGroupName fg

이 명령은 하나의 데이터베이스를 파이핑하여 장애 조치(failover) 그룹에 추가합니다.

예제 2

PS C:\> $primaryServer = Get-AzureRmSqlServer -ResourceGroupName rg -ServerName primaryserver
PS C:\> $failoverGroup = $primaryServer | Add-AzureRmSqlDatabaseToFailoverGroup -FailoverGroupName fg -Database ($primaryServer | Get-AzureRmSqlDatabase)

이 명령은 서버의 모든 데이터베이스를 장애 조치(failover) 그룹에 추가합니다.

예 3

PS C:\> $failoverGroup = Get-AzureRmSqlDatabaseFailoverGroup -ResourceGroupName rg -ServerName primaryserver -FailoverGroupName fg
PS C:\> $databases = Get-AzureRmSqlElasticPoolDatabase -ResourceGroupName rg -ServerName primaryserver -ElasticPoolName pool1
PS C:\> $failoverGroup = $failoverGroup | Add-AzureRmSqlDatabaseToFailoverGroup -Database $databases

이 명령은 탄력적 풀의 모든 데이터베이스를 장애 조치(failover) 그룹에 추가합니다.

매개 변수

-Database

장애 조치(failover) 그룹의 주 서버에 있는 하나 이상의 Azure SQL Database를 장애 조치(failover) 그룹에 추가합니다.

형식:List<T>[AzureSqlDatabaseModel]
Position:Named
Default value:None
필수:True
파이프라인 입력 허용:True
와일드카드 문자 허용:False

-DefaultProfile

Azure와의 통신에 사용되는 자격 증명, 계정, 테넌트 및 구독

형식:IAzureContextContainer
별칭:AzureRmContext, AzureCredential
Position:Named
Default value:None
필수:False
파이프라인 입력 허용:False
와일드카드 문자 허용:False

-FailoverGroupName

Azure SQL Database 장애 조치(failover) 그룹의 이름입니다.

형식:String
Position:2
Default value:None
필수:True
파이프라인 입력 허용:True
와일드카드 문자 허용:False

-ResourceGroupName

리소스 그룹의 이름입니다.

형식:String
Position:0
Default value:None
필수:True
파이프라인 입력 허용:True
와일드카드 문자 허용:False

-ServerName

장애 조치(failover) 그룹의 기본 Azure SQL Database 서버 이름입니다.

형식:String
Position:1
Default value:None
필수:True
파이프라인 입력 허용:True
와일드카드 문자 허용:False

입력

String

List<T>[[Microsoft.Azure.Commands.Sql.Database.Model.AzureSqlDatabaseModel, Microsoft.Azure.Commands.Sql, Version=4.11.0.0, Culture=neutral, PublicKeyToken=null]]

출력

AzureSqlFailoverGroupModel