Suspend-SqlAvailabilityDatabase

Suspends data movement on an availability database on the replica hosted by the current server instance.
Suspend-SqlAvailabilityDatabase [[-Path] <string>] [-Script] [-Confirm] [-WhatIf] [<CommonParameters>]
Suspend-SqlAvailabilityDatabase [-InputObject*] <AvailabilityDatabase> [-Script] [-Confirm] [-WhatIf][<CommonParameters>]

The Suspend-SqlAvailabilityDatabase cmdlet suspends data movement on an availability database on the replica that is hosted by the current server instance. When a secondary database is suspended, its state is set to SUSPENDED and it will being to fall behind the corresponding primary database. Suspending a primary database suspends data movement on every secondary replica.

Parameters
-InputObject <AvailabilityDatabase>

  • This value is required
  • Accepts pipeline input ByValue

The AvailabilityDatabase object of the primary or secondary database for which data movement is to be suspended.

-Path <string>

The path to the availability database. This is an optional parameter. If not specified, the value of this parameter defaults to the current working location.

-Script [<SwitchParameter>]

Outputs a Transact-SQL script that performs the task executed by this cmdlet.

-Confirm [<SwitchParameter>]

Prompts you for confirmation before executing the command.

-WhatIf [<SwitchParameter>]

Describes what would happen if you executed the command without actually executing the command.

<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,ErrorAction, ErrorVariable, WarningAction, WarningVariable,OutBuffer, PipelineVariable, and OutVariable.

Inputs

Microsoft.SqlServer.Management.Smo.AvailabilityDatabase

Specifies the availability database for which data movement is to be suspended.

Examples
  1. This command suspends data synchronization for the availability database ‘MyDatabase’ in the availability group ‘MyAg’ on the server instance named ‘ComputerInstance’:
    C:PS> Suspend-SqlAvailabilityDatabase -Path SQLSERVER:SqlComputerInstanceAvailabilityGroupsMyAgAvailabilityDatabasesMyDatabase
    
  2. This command suspends data synchronization for all availability databases in the availability group ‘MyAg’ on the server instance named ‘ComputerInstance’:
    C:PS> dir SQLSERVER:SqlComputerInstanceAvailabilityGroupsMyAgAvailabilityDatabases | Suspend-SqlAvailabilityDatabase
    
  3. This command outputs the Transact-SQL script that suspends data synchronization for the availability database ‘MyDatabase’ in the availability group ‘MyAg’ on the server instance named ‘ComputerInstance’:
    C:PS> Suspend-SqlAvailabilityDatabase -Path SQLSERVER:SqlComputerInstanceAvailabilityGroupsMyAgAvailabilityDatabasesMyDatabase -Script
    
Additional Notes
 The instance on which this command is executed must be enabled for high availability.