Skip to content

Commit 80ee905

Browse files
Merge pull request #36297 from MicrosoftDocs/main
Auto Publish – main to live - 2026-01-19 23:30 UTC
2 parents 8a17bea + f8bb7ea commit 80ee905

9 files changed

Lines changed: 209 additions & 75 deletions
Lines changed: 28 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
---
2-
title: "Create a database snapshot for an availability group"
2+
title: "Create a Database Snapshot for an Availability Group"
33
description: "Describes how to create a database snapshot for a database within an Always On availability group on either the primary or secondary database."
44
author: MashaMSFT
55
ms.author: mathoma
6-
ms.date: "05/17/2016"
6+
ms.reviewer: randolphwest
7+
ms.date: 01/19/2026
78
ms.service: sql
89
ms.subservice: availability-groups
910
ms.topic: how-to
@@ -12,27 +13,30 @@ helpviewer_keywords:
1213
- "database snapshots [SQL Server], Always On Availability Groups"
1314
- "Availability Groups [SQL Server], interoperability"
1415
---
15-
# Database Snapshots with Always On Availability Groups (SQL Server)
16+
# Database snapshots with Always On availability groups (SQL Server)
17+
1618
[!INCLUDE [SQL Server](../../../includes/applies-to-version/sqlserver.md)]
1719

18-
[!NOTE] 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.
19-
20-
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.
21-
22-
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.
23-
24-
A database snapshot on a secondary replica should continue to work if the replica is DISCONNECTED from the primary replica.
25-
26-
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:
27-
28-
- 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.
29-
30-
- The database enters the secondary role.
31-
32-
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.
33-
34-
## See Also
35-
[Overview of Always On Availability Groups (SQL Server)](../../../database-engine/availability-groups/windows/overview-of-always-on-availability-groups-sql-server.md)
36-
[Database Snapshots (SQL Server)](../../../relational-databases/databases/database-snapshots-sql-server.md)
37-
38-
20+
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)
42+
- [Database snapshots (SQL Server)](../../../relational-databases/databases/database-snapshots-sql-server.md)

docs/relational-databases/system-dynamic-management-views/linux-related-dynamic-management-views-and-functions-transact-sql.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ dev_langs:
1717

1818
[!INCLUDE [sqlserver2025-linux](../../includes/applies-to-version/sqlserver2025-linux.md)]
1919

20-
The following dynamic management objects return system-level Linux metrics beyond SQL Server, for a comprehensive visibility into overall host performance.
20+
The following dynamic management objects return system-level Linux metrics beyond SQL Server, so you get comprehensive visibility into overall host performance.
2121

22-
These objects provide detailed CPU statistics, real-time network interface activity (bytes and packets sent and received, errors, drops, and collisions), and disk I/O statistics for each storage device.
22+
These objects provide detailed CPU statistics, real-time network interface activity (bytes and packets sent and received, errors, drops, and collisions), disk I/O statistics for each storage device, and virtual memory statistics.
2323

2424
## In this section
2525

2626
- [sys.dm_os_linux_cpu_stats](sys-dm-os-linux-cpu-stats-transact-sql.md)
2727
- [sys.dm_os_linux_disk_stats](sys-dm-os-linux-disk-stats-transact-sql.md)
2828
- [sys.dm_os_linux_net_stats](sys-dm-os-linux-net-stats-transact-sql.md)
29+
- [sys.dm_os_linux_vm_stats](sys-dm-os-linux-vm-stats-transact-sql.md)
2930

3031
## Related content
3132

docs/relational-databases/system-dynamic-management-views/sys-dm-os-linux-cpu-stats-transact-sql.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,23 +53,27 @@ Requires `VIEW SERVER PERFORMANCE STATE` permission on the server.
5353

5454
## Remarks
5555

56-
This DMV provides cumulative statistics since the system was started.
56+
This DMV provides cumulative statistics since the system started.
5757

58-
Values aren't limited to SQL Server activity; they reflect the entire Linux host.
58+
Values aren't limited to SQL Server activity. They reflect the entire Linux host.
5959

6060
For more information on interpreting Linux CPU statistics, see the `proc_stat(5)` manual page for your distribution.
6161

62-
Use this DMV with other Linux-specific DMVs, such as [sys.dm_os_linux_disk_stats](sys-dm-os-linux-disk-stats-transact-sql.md) and [sys.dm_os_linux_net_stats](sys-dm-os-linux-net-stats-transact-sql.md), for holistic monitoring.
62+
Use this DMV with other Linux-specific DMVs for holistic monitoring:
63+
64+
- [sys.dm_os_linux_disk_stats](sys-dm-os-linux-disk-stats-transact-sql.md)
65+
- [sys.dm_os_linux_net_stats](sys-dm-os-linux-net-stats-transact-sql.md)
66+
- [sys.dm_os_linux_vm_stats](sys-dm-os-linux-vm-stats-transact-sql.md)
6367

6468
### Usage scenarios
6569

6670
- **Diagnose CPU saturation**: Use `loadavg_1min`, `proc_runable_cnt`, and `user_time_cs` to identify if the system is under heavy CPU load.
6771

6872
- **Investigate I/O waits**: High `iowait_time_cs` or `proc_ioblocked_cnt` values could indicate storage bottlenecks.
6973

70-
- **Analyze system responsiveness**: Frequent context switches (`csw_cnt`) or interrupts (`interrupt_cnt`) can signal issues with system scheduling or hardware.
74+
- **Analyze system responsiveness**: Frequent context switches (`csw_cnt`) or interrupts (`interrupt_cnt`) can signal problems with system scheduling or hardware.
7175

72-
- **Correlate SQL Server performance with system activity**: Since these metrics are system-wide, they help distinguish between SQL Server-specific and broader OS-level issues.
76+
- **Correlate SQL Server performance with system activity**: Since these metrics are system-wide, they help you distinguish between SQL Server-specific and broader OS-level problems.
7377

7478
## Examples
7579

@@ -128,4 +132,5 @@ WHERE scheduler_id < 255;
128132

129133
- [sys.dm_os_linux_disk_stats (Transact-SQL)](sys-dm-os-linux-disk-stats-transact-sql.md)
130134
- [sys.dm_os_linux_net_stats (Transact-SQL)](sys-dm-os-linux-net-stats-transact-sql.md)
135+
- [sys.dm_os_linux_vm_stats (Transact-SQL)](sys-dm-os-linux-vm-stats-transact-sql.md)
131136
- [Performance best practices and configuration guidelines for SQL Server on Linux](../../linux/sql-server-linux-performance-best-practices.md)

docs/relational-databases/system-dynamic-management-views/sys-dm-os-linux-disk-stats-transact-sql.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,11 @@ Requires `VIEW SERVER PERFORMANCE STATE` permission on the server.
6464

6565
- **Use with care in multitenant hosts**: High values can originate from non-SQL Server workloads. Correlate with system tools or other DMVs for attribution.
6666

67-
Use this DMV with other Linux-specific DMVs, such as [sys.dm_os_linux_disk_stats](sys-dm-os-linux-disk-stats-transact-sql.md) and [sys.dm_os_linux_net_stats](sys-dm-os-linux-net-stats-transact-sql.md), for holistic monitoring.
67+
Use this DMV with other Linux-specific DMVs for holistic monitoring:
68+
69+
- [sys.dm_os_linux_cpu_stats](sys-dm-os-linux-cpu-stats-transact-sql.md)
70+
- [sys.dm_os_linux_net_stats](sys-dm-os-linux-net-stats-transact-sql.md)
71+
- [sys.dm_os_linux_vm_stats](sys-dm-os-linux-vm-stats-transact-sql.md)
6872

6973
### Usage scenarios
7074

@@ -203,4 +207,5 @@ ORDER BY ios_in_progress DESC,
203207

204208
- [sys.dm_os_linux_cpu_stats (Transact-SQL)](sys-dm-os-linux-cpu-stats-transact-sql.md)
205209
- [sys.dm_os_linux_net_stats (Transact-SQL)](sys-dm-os-linux-net-stats-transact-sql.md)
210+
- [sys.dm_os_linux_vm_stats (Transact-SQL)](sys-dm-os-linux-vm-stats-transact-sql.md)
206211
- [Performance best practices and configuration guidelines for SQL Server on Linux](../../linux/sql-server-linux-performance-best-practices.md)

docs/relational-databases/system-dynamic-management-views/sys-dm-os-linux-net-stats-transact-sql.md

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,11 @@ This DMV provides system-level network metrics and isn't limited to SQL Server a
5353

5454
`sys.dm_os_linux_net_stats` is useful for diagnosing network problems that might affect SQL Server connectivity, Always On availability groups, replication, or client/server communication.
5555

56-
Use this DMV with other Linux-specific DMVs, such as [sys.dm_os_linux_cpu_stats](sys-dm-os-linux-cpu-stats-transact-sql.md) and [sys.dm_os_linux_disk_stats](sys-dm-os-linux-disk-stats-transact-sql.md), for holistic monitoring.
56+
Use this DMV with other Linux-specific DMVs for holistic monitoring:
57+
58+
- [sys.dm_os_linux_cpu_stats](sys-dm-os-linux-cpu-stats-transact-sql.md)
59+
- [sys.dm_os_linux_disk_stats](sys-dm-os-linux-disk-stats-transact-sql.md)
60+
- [sys.dm_os_linux_vm_stats](sys-dm-os-linux-vm-stats-transact-sql.md)
5761

5862
### Usage scenarios
5963

@@ -80,7 +84,7 @@ FROM sys.dm_os_linux_net_stats;
8084

8185
### B. Identify interfaces with packet errors or drops
8286

83-
Use the following query to focus on interfaces experiencing problems, filtering for nonzero error or drop counts.
87+
Use the following query to focus on interfaces experiencing problems. It filters for nonzero error or drop counts.
8488

8589
```sql
8690
SELECT interface,
@@ -99,7 +103,7 @@ WHERE recv_errors > 0
99103

100104
Measure network throughput for each interface over a specific interval. This measurement helps you in capacity planning, and identifies bottlenecks during peak workloads.
101105

102-
The following query tracks network usage trends, periodically samples bytes sent and received, and calculates the delta.
106+
The following query tracks network usage trends. It periodically samples bytes sent and received, and calculates the delta.
103107

104108
Take a baseline snapshot:
105109

@@ -135,7 +139,7 @@ WHERE recv_multicast > 0;
135139

136140
### E. Correlate network statistics with wait statistics
137141

138-
If you observe high `NETWORK_IO` waits, check for corresponding network errors or drops to pinpoint the root cause of query delays.
142+
If you see high `NETWORK_IO` waits, check for matching network errors or drops to identify the root cause of query delays.
139143

140144
Combine network stats with wait statistics to diagnose if network problems are causing SQL Server waits:
141145

@@ -152,9 +156,9 @@ WHERE w.wait_type LIKE '%NETWORK_IO%';
152156

153157
### F. Find interfaces with high collision counts
154158

155-
Detect and address network segments with excessive collisions, which might degrade SQL Server performance.
159+
Detect and fix network segments with excessive collisions, which might slow down SQL Server performance.
156160

157-
Collisions can indicate network congestion or misconfigured hardware:
161+
Collisions can show network congestion or misconfigured hardware:
158162

159163
```sql
160164
SELECT interface,
@@ -165,9 +169,9 @@ WHERE tx_collisions > 0;
165169

166170
### G. Baseline and alerting example
167171

168-
Integrate with monitoring tools to proactively notify database administrators of potential network problems before they affect SQL Server workloads.
172+
Integrate with monitoring tools to proactively notify database administrators about potential network problems before they affect SQL Server workloads.
169173

170-
Use this DMV in automated monitoring scripts to alert when error or drop counts increase unexpectedly.
174+
Use this DMV in automated monitoring scripts to alert when error or drop counts unexpectedly increase.
171175

172176
Alert if any interface has more than 10 errors or drops:
173177

@@ -203,4 +207,5 @@ WHERE recv_errors > 10
203207

204208
- [sys.dm_os_linux_cpu_stats (Transact-SQL)](sys-dm-os-linux-cpu-stats-transact-sql.md)
205209
- [sys.dm_os_linux_disk_stats (Transact-SQL)](sys-dm-os-linux-disk-stats-transact-sql.md)
210+
- [sys.dm_os_linux_vm_stats (Transact-SQL)](sys-dm-os-linux-vm-stats-transact-sql.md)
206211
- [Performance best practices and configuration guidelines for SQL Server on Linux](../../linux/sql-server-linux-performance-best-practices.md)
Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
---
2+
title: "sys.dm_os_linux_vm_stats (Transact-SQL)"
3+
description: sys.dm_os_linux_vm_stats returns a table with detailed Linux CPU statistics, offering system-level insights beyond SQL Server.
4+
author: rwestMSFT
5+
ms.author: randolphwest
6+
ms.date: 01/19/2026
7+
ms.service: sql
8+
ms.subservice: system-objects
9+
ms.topic: "reference"
10+
f1_keywords:
11+
- "dm_os_linux_vm_stats"
12+
- "sys.dm_os_linux_vm_stats_TSQL"
13+
- "dm_os_linux_vm_stats_TSQL"
14+
- "sys.dm_os_linux_vm_stats"
15+
helpviewer_keywords:
16+
- "sys.dm_os_linux_vm_stats dynamic management view"
17+
dev_langs:
18+
- "TSQL"
19+
---
20+
# sys.dm_os_linux_vm_stats (Transact-SQL)
21+
22+
[!INCLUDE [sqlserver2025-linux](../../includes/applies-to-version/sqlserver2025-linux.md)]
23+
24+
Returns Linux operating system-level virtual memory statistics, including metrics related to SQL Server and other processes running on the system, in [!INCLUDE [sssql25-md](../../includes/sssql25-md.md)] Cumulative Update (CU) 1 and later versions.
25+
26+
| Column name | Data type | Nullable | Description |
27+
| --- | --- | --- | --- |
28+
| `vm_metric_name` | **nvarchar(256)** | No | Virtual memory metric name. |
29+
| `count` | **bigint** | No | Corresponding statistic for that metric. |
30+
31+
## Permissions
32+
33+
Requires `VIEW SERVER PERFORMANCE STATE` permission on the server.
34+
35+
## Remarks
36+
37+
`sys.dm_os_linux_vm_stats` provides system-wide memory observability to help you analyze memory pressure, page faults, reclaim activity, non-uniform memory access (NUMA) behavior, and to correlate SQL Server performance with overall OS memory health.
38+
39+
Each row represents a single virtual memory metric, typically sourced from Linux interfaces such as `/proc/vmstat`. Metric availability and meaning can vary by Linux distribution, kernel version, and configuration.
40+
41+
Use this DMV with other Linux-specific DMVs for holistic monitoring:
42+
43+
- [sys.dm_os_linux_cpu_stats](sys-dm-os-linux-cpu-stats-transact-sql.md)
44+
- [sys.dm_os_linux_disk_stats](sys-dm-os-linux-disk-stats-transact-sql.md)
45+
- [sys.dm_os_linux_net_stats](sys-dm-os-linux-net-stats-transact-sql.md)
46+
47+
### Usage scenarios
48+
49+
Common scenarios for using `sys.dm_os_linux_vm_stats` include:
50+
51+
- Investigating out-of-memory (OOM) events on Linux hosts.
52+
- Correlating SQL Server memory symptoms with OS reclaim activity.
53+
- Understanding NUMA-related memory behavior on multinode systems.
54+
- Performing deep OS-level observability directly from Transact-SQL.
55+
56+
## Examples
57+
58+
### A. View all virtual memory statistics
59+
60+
The following query returns all available virtual memory metrics reported by the Linux kernel:
61+
62+
```sql
63+
SELECT *
64+
FROM sys.dm_os_linux_vm_stats;
65+
```
66+
67+
### B. Identify page fault activity
68+
69+
The following query highlights page fault-related metrics, which can help identify memory pressure or inefficient memory access patterns:
70+
71+
```sql
72+
SELECT vm_metric_name,
73+
count
74+
FROM sys.dm_os_linux_vm_stats
75+
WHERE vm_metric_name IN ('pgfault', 'pgmajfault');
76+
```
77+
78+
### C. Monitor locality of NUMA memory
79+
80+
Returns NUMA-related virtual memory metrics to help understand memory locality across nodes:
81+
82+
```sql
83+
SELECT vm_metric_name,
84+
count
85+
FROM sys.dm_os_linux_vm_stats
86+
WHERE vm_metric_name LIKE 'numa%';
87+
```
88+
89+
### D. Analyze activity for memory reclaim and compaction
90+
91+
The following query helps you diagnose memory reclaim behavior and compaction pressure on the system:
92+
93+
```sql
94+
SELECT vm_metric_name,
95+
count
96+
FROM sys.dm_os_linux_vm_stats
97+
WHERE vm_metric_name LIKE 'pgsteal%'
98+
OR vm_metric_name LIKE 'pgscan%'
99+
OR vm_metric_name LIKE 'compact%';
100+
```
101+
102+
## Related content
103+
104+
- [sys.dm_os_linux_cpu_stats (Transact-SQL)](sys-dm-os-linux-cpu-stats-transact-sql.md)
105+
- [sys.dm_os_linux_disk_stats (Transact-SQL)](sys-dm-os-linux-disk-stats-transact-sql.md)
106+
- [sys.dm_os_linux_net_stats (Transact-SQL)](sys-dm-os-linux-net-stats-transact-sql.md)
107+
- [Performance best practices and configuration guidelines for SQL Server on Linux](../../linux/sql-server-linux-performance-best-practices.md)

0 commit comments

Comments
 (0)