You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: "Create a database snapshot for an availability group"
2
+
title: "Create a Database Snapshot for an Availability Group"
3
3
description: "Describes how to create a database snapshot for a database within an Always On availability group on either the primary or secondary database."
4
4
author: MashaMSFT
5
5
ms.author: mathoma
6
-
ms.date: "05/17/2016"
6
+
ms.reviewer: randolphwest
7
+
ms.date: 01/19/2026
7
8
ms.service: sql
8
9
ms.subservice: availability-groups
9
10
ms.topic: how-to
@@ -12,28 +13,30 @@ helpviewer_keywords:
12
13
- "database snapshots [SQL Server], Always On Availability Groups"
13
14
- "Availability Groups [SQL Server], interoperability"
14
15
---
15
-
# Database Snapshots with Always On Availability Groups (SQL Server)
16
+
# Database snapshots with Always On availability groups (SQL Server)
> Creating database snapshots on any database has cpu and IO overhead due to copy on write activity. On database replicas, this can hurt redo throughput among other operations, especially as the number of snapshots increases.
20
-
21
-
You can create a database snapshot on an primary or secondary database in an availability group. The replica role must be either PRIMARY or SECONDARY, not in the RESOLVING state.
22
-
23
-
We recommend that the database synchronization state be SYNCHRONIZING or SYNCHRONIZED when you create a database snapshot. However, database snapshots can be created when the database synchronization state is NOT SYNCHRONIZING.
24
-
25
-
A database snapshot on a secondary replica should continue to work if the replica is DISCONNECTED from the primary replica.
26
-
27
-
Some [!INCLUDE[ssHADR](../../../includes/sshadr-md.md)] conditions cause both the source database and its database snapshots to be restarted, temporarily disconnecting users. These conditions are as follows:
28
-
29
-
- The primary replica changes roles, whether because the current primary replica goes off line and comes back online on the same server instance or because the availability group fails over.
30
-
31
-
- The database enters the secondary role.
32
-
33
-
If the availability replica that hosts database snapshots is failed over, the database snapshots remain on the server instance where they were created. Users can continue to use the snapshots after the failover.If performance is a concern in your environment, we recommend that you create database snapshots only on secondary databases that are hosted by a secondary replica that is configured for manual failover mode. If you ever manually fail over the availability group to this secondary replica, you can create a new set of database snapshots on another secondary replica, redirect clients to the new database snapshots, and drop all of the database snapshots from the now primary databases.
34
-
35
-
## See Also
36
-
[Overview of Always On Availability Groups (SQL Server)](../../../database-engine/availability-groups/windows/overview-of-always-on-availability-groups-sql-server.md)
You can create a database snapshot on a primary or secondary database in an availability group. The replica role must be either `PRIMARY` or `SECONDARY`, and can't be in the `RESOLVING` state.
21
+
22
+
> [!NOTE]
23
+
> Creating database snapshots on any database adds CPU and I/O overhead because of copy-on-write activity. On database replicas, this overhead can reduce redo throughput and affect other operations, especially as the number of snapshots increases.
24
+
25
+
You should create database snapshots when the database synchronization state is `SYNCHRONIZING` or `SYNCHRONIZED`. However, you can still create database snapshots when the database synchronization state is `NOT SYNCHRONIZING`.
26
+
27
+
A database snapshot on a secondary replica continues to work if the replica is `DISCONNECTED` from the primary replica.
28
+
29
+
Some [!INCLUDE [ssHADR](../../../includes/sshadr-md.md)] conditions cause both the source database and its database snapshots to restart, temporarily disconnecting users. These conditions are as follows:
30
+
31
+
- The primary replica changes roles. This change can happen because the current primary replica goes offline and comes back online on the same server instance, or because the availability group fails over.
32
+
33
+
- The database enters the secondary role.
34
+
35
+
If the availability replica that hosts database snapshots fails over, the database snapshots remain on the server instance where you created them. You can continue to use the snapshots after the failover. If performance is a concern in your environment, create database snapshots only on secondary databases hosted by a secondary replica that is configured for manual failover mode.
36
+
37
+
If you ever manually fail over the availability group to this secondary replica, you can create a new set of database snapshots on another secondary replica, redirect clients to the new database snapshots, and drop all of the database snapshots from the now primary databases.
38
+
39
+
## Related content
40
+
41
+
-[What is an Always On availability group?](overview-of-always-on-availability-groups-sql-server.md)
0 commit comments