Resume an Availability Database (SQL Server)
You can resume a suspended availability database in AlwaysOn Availability Groups by using SQL Server Management Studio, Transact-SQL, or PowerShell in SQL Server 2012. Resuming a suspended database puts the database into the SYNCHRONIZING state. Resuming the primary database also resumes any of its secondary databases that were suspended as the result of suspending the primary database. If any secondary database was suspended locally, from the server instance that hosts the secondary replica, that secondary database must be resumed locally. Once a given secondary database and the corresponding primary database are in the SYNCHRONIZING state, data synchronization resumes on the secondary database.
[!UWAGA]
Suspending and resuming an AlwaysOn secondary database does not directly affect the availability of the primary database. However, suspending a secondary database can impact redundancy and failover capabilities for the primary database, until the suspended secondary database is resumed. This is in contrast to database mirroring, where the mirroring state is suspended on both the mirror database and the principal database until mirroring is resumed. Suspending an AlwaysOn primary database suspends data movement on all the corresponding secondary databases, and redundancy and failover capabilities cease for that database until the primary database is resumed.
Before you begin:
Limitations and Restrictions
Prerequisites
Security
To resume a secondary database, using:
SQL Server Management Studio
Transact-SQL
PowerShell
Related Tasks
Before You Begin
Limitations and Restrictions
A RESUME command returns as soon as it has been accepted by the replica that hosts the target database, but actually resuming the database occurs asynchronously.
Prerequisites
You must be connected to the server instance that hosts the database to be resumed.
The availability group must be online.
The primary database must be online and available.
Security
Permissions
Requires ALTER permission on the database.
Requires ALTER AVAILABILITY GROUP permission on the availability group, CONTROL AVAILABILITY GROUP permission, ALTER ANY AVAILABILITY GROUP permission, or CONTROL SERVER permission.
[Top]
Using SQL Server Management Studio
To resume a secondary database
In Object Explorer, connect to the server instance that hosts the availability replica on which you want to resume a database, and expand the server tree.
Expand the AlwaysOn High Availability node and the Availability Groups node.
Expand the availability group.
Expand the Availability Databases node, right-click the database, and click Resume Data Movement.
In the Resume Data Movement dialog box, click OK.
[!UWAGA]
To resume additional databases on this replica location, repeat steps 4 and 5 for each database.
[Top]
Using Transact-SQL
To resume a secondary database that was suspended locally
Connect to the server instance that hosts the secondary replica whose database you want to resume.
Resume the secondary database by using the following ALTER DATABASE statement:
ALTER DATABASE database_name SET HADR RESUME
[Top]
Using PowerShell
To resume a secondary database
Change directory (cd) to the server instance that hosts the replica whose database you want to resume. For more information, see Prerequisites, earlier in this topic.
Use the Resume-SqlAvailabilityDatabase cmdlet to resume the availability group.
For example, the following command resumes data synchronization for the availability database MyDb3 in the availability group MyAg.
Resume-SqlAvailabilityDatabase ` -Path SQLSERVER:\Sql\Computer\Instance\AvailabilityGroups\MyAg\Databases\MyDb3
[!UWAGA]
To view the syntax of a cmdlet, use the Get-Help cmdlet in the SQL Server PowerShell environment. For more information, see Get Help SQL Server PowerShell.
To set up and use the SQL Server PowerShell provider
[Top]