Abra la consola SQLPS y suspenda el movimiento de datos para la réplica de base de datos de destino.
Target | Microsoft.SQLServer.2014.AlwaysOn.DatabaseReplica |
Application | sqlps.exe |
WorkingDirectory | |
isRequireOutput | False |
Accessibility | Internal |
Enabled | True |
<ConsoleTask ID="Microsoft.SQLServer.2014.AlwaysOn.SuspendDataMovement" Accessibility="Internal" Target="AlwaysOnDisc!Microsoft.SQLServer.2014.AlwaysOn.DatabaseReplica" RequireOutput="false" Category="MonitoringObject">
<Application>sqlps.exe</Application>
<Parameters>
<Parameter>-NoExit</Parameter>
<Parameter>"&{ New-Variable -Name dbReplicaName -Value ([regex]::Replace('$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2014.AlwaysOn.DatabaseReplica"]/AvailabilityDatabaseName$', '\\', '%5C')); function p{ param($v) if ($v -ilike '*\*') { return $v } else { return '{0}\DEFAULT' -f $v } }; New-Variable -Name rp -Value ('{0}' -f (p(\"$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2014.AlwaysOn.DatabaseReplica"]/AvailabilityReplicaServerName$\"))); New-Variable -Name ag -Value (\"$Target/Property[Type="AlwaysOnDisc!Microsoft.SQLServer.2014.AlwaysOn.DatabaseReplica"]/AvailabilityGroupName$\"); cd SQL\$rp\AvailabilityGroups\$ag\AvailabilityDatabases\$dbReplicaName\; Suspend-SqlAvailabilityDatabase -Confirm; Write-Host "Press any key to exit..."; $key=[Console]::ReadKey($true); Exit }"</Parameter>
</Parameters>
<WorkingDirectory/>
</ConsoleTask>