Open SQLPS console and fail over to target Availability Replica that will make this replica to the new primary of availability group. In this task -AllowDataLoss parameter is used.
Target | Microsoft.SQLServer.Windows.AvailabilityReplica |
Application | powershell.exe |
WorkingDirectory | |
isRequireOutput | False |
Accessibility | Internal |
Enabled | True |
<ConsoleTask ID="Microsoft.SQLServer.Windows.ConsoleTask.AvailabilityReplica.ForcedFailover" Accessibility="Internal" Target="SqlDiscW!Microsoft.SQLServer.Windows.AvailabilityReplica" RequireOutput="false">
<Assembly>Res.Microsoft.SQLServer.Windows.ConsoleTask.AvailabilityReplica.ForcedFailover</Assembly>
<Handler>ShellHandler</Handler>
<Parameters>
<Argument Name="Application">powershell.exe</Argument>
<Argument Name="WorkingDirectory"/>
<Argument>-NoExit -NoLogo -NoProfile -Command Invoke-Command {
$isForcedFailover = $true
$IncludeFileContent/Scripts/PsTaskCommon.ps1$
$IncludeFileContent/Scripts/FailoverTaskCommon.ps1$
}</Argument>
</Parameters>
</ConsoleTask>