Skip to content

Commit 94d3250

Browse files
Merge pull request #28595 from rwestMSFT/rw-0927-fix-9351
Refresh create database snapshot and include issue 9351
2 parents 9593a49 + 4c66988 commit 94d3250

1 file changed

Lines changed: 12 additions & 15 deletions

File tree

docs/relational-databases/databases/create-a-database-snapshot-transact-sql.md

Lines changed: 12 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: "Find out how to create a SQL Server database snapshot by using Tra
44
author: WilliamDAssafMSFT
55
ms.author: wiassaf
66
ms.reviewer: randolphwest
7-
ms.date: 07/21/2023
7+
ms.date: 09/28/2023
88
ms.service: sql
99
ms.subservice: configuration
1010
ms.topic: conceptual
@@ -15,21 +15,21 @@ helpviewer_keywords:
1515

1616
[!INCLUDE [SQL Server](../../includes/applies-to-version/sqlserver.md)]
1717

18-
The only way to create a [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] database snapshot is to use [!INCLUDE[tsql](../../includes/tsql-md.md)]. [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] doesn't support the creation of database snapshots.
18+
The only way to create a [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] database snapshot is to use [!INCLUDE [tsql](../../includes/tsql-md.md)]. [!INCLUDE [ssManStudioFull](../../includes/ssmanstudiofull-md.md)] doesn't support the creation of database snapshots.
1919

2020
## Prerequisites
2121

2222
The source database, which can use any recovery model, must meet the following prerequisites:
2323

24-
- The server instance must be running an edition of [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] that supports database snapshot. For information about support for database snapshots in [!INCLUDE[ssnoversion](../../includes/ssnoversion-md.md)], see [Editions and supported features of SQL Server 2022](../../sql-server/editions-and-components-of-sql-server-2022.md).
24+
- The server instance must be running an edition of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] that supports database snapshot. For information about support for database snapshots in [!INCLUDE [ssnoversion](../../includes/ssnoversion-md.md)], see [Editions and supported features of SQL Server 2022](../../sql-server/editions-and-components-of-sql-server-2022.md).
2525

2626
- The source database must be online, unless the database is a mirror database within a database mirroring session.
2727

2828
- To create a database snapshot on a mirror database, the database must be in the synchronized [mirroring state](../../database-engine/database-mirroring/mirroring-states-sql-server.md).
2929

3030
- The source database can't be configured as a scalable shared database.
3131

32-
- Prior to SQL Server 2019, the source database could not contain a MEMORY_OPTIMIZED_DATA filegroup. Support for in-memory database snapshots was added in SQL Server 2019.
32+
- Prior to [!INCLUDE [sssql19-md](../../includes/sssql19-md.md)], the source database couldn't contain a `MEMORY_OPTIMIZED_DATA` filegroup. Support for in-memory database snapshots was added in [!INCLUDE [sssql19-md](../../includes/sssql19-md.md)].
3333

3434
> [!IMPORTANT]
3535
> For information about other significant considerations, see [Database Snapshots (SQL Server)](database-snapshots-sql-server.md).
@@ -44,15 +44,15 @@ This section discusses the following best practices:
4444

4545
#### <a id="naming"></a> Best practice: naming database snapshots
4646

47-
Before creating snapshots, it is important to consider how to name them. Each database snapshot requires a unique database name. For administrative ease, the name of a snapshot can incorporate information that identifies the database, such as:
47+
Before creating snapshots, it's important to consider how to name them. Each database snapshot requires a unique database name. For administrative ease, the name of a snapshot can incorporate information that identifies the database, such as:
4848

4949
- The name of the source database.
5050

5151
- An indication that the new name is for a snapshot.
5252

5353
- The creation date and time of the snapshot, a sequence number, or some other information, such as time of day, to distinguish sequential snapshots on a given database.
5454

55-
For example, consider a series of snapshots for the [!INCLUDE[ssSampleDBobject](../../includes/sssampledbobject-md.md)] database. Three daily snapshots are created at 6-hour intervals between 6 A.M. and 6 P.M., based on a 24-hour clock. Each daily snapshot is kept for 24 hours before being dropped and replaced by a new snapshot of the same name. Each snapshot name indicates the hour, but not the day:
55+
For example, consider a series of snapshots for the [!INCLUDE [ssSampleDBobject](../../includes/sssampledbobject-md.md)] database. Three daily snapshots are created at 6-hour intervals between 6 A.M. and 6 P.M., based on a 24-hour clock. Each daily snapshot is kept for 24 hours before being dropped and replaced by a new snapshot of the same name. Each snapshot name indicates the hour, but not the day:
5656

5757
```output
5858
AdventureWorks_snapshot_0600
@@ -70,14 +70,14 @@ AdventureWorks_snapshot_evening
7070

7171
#### <a id="limiting-number"></a> Best practice: limiting the number of database snapshots
7272

73-
Creating a series of snapshots over time captures sequential snapshots of the source database. Each snapshot persists until it is explicitly dropped. Because each snapshot will continue to grow as original pages are updated, you may want to conserve disk space by deleting an older snapshot after creating a new snapshot.
73+
Creating a series of snapshots over time captures sequential snapshots of the source database. Each snapshot persists until it's explicitly dropped. Because each snapshot will continue to grow as original pages are updated, you may want to conserve disk space by deleting an older snapshot after creating a new snapshot.
7474

7575
> [!NOTE]
7676
> To revert to a database snapshot, you need to delete any other snapshots from that database.
7777
7878
#### <a id="client-connections"></a> Best practice: client connections to a database snapshot
7979

80-
To use a database snapshot, clients need to know where to find it. Users can read from one database snapshot while another is being created or deleted. However, when you substitute a new snapshot for an existing one, you need to redirect clients to the new snapshot. Users can manually connect to a database snapshot with [!INCLUDE[ssManStudioFull](../../includes/ssmanstudiofull-md.md)] or Azure Data Studio. However, to support a production environment, you should create a programmatic solution that transparently directs report-writing clients to the latest database snapshot of the database.
80+
To use a database snapshot, clients need to know where to find it. Users can read from one database snapshot while another is being created or deleted. However, when you substitute a new snapshot for an existing one, you need to redirect clients to the new snapshot. Users can manually connect to a database snapshot with [!INCLUDE [ssManStudioFull](../../includes/ssmanstudiofull-md.md)] or Azure Data Studio. However, to support a production environment, you should create a programmatic solution that transparently directs report-writing clients to the latest database snapshot of the database.
8181

8282
## Permissions
8383

@@ -96,7 +96,7 @@ Any user who can create a database can create a database snapshot; however, to c
9696
NAME = logical_file_name
9797
, FILENAME = 'os_file_name'
9898
) [ , ...n ]
99-
99+
100100
AS SNAPSHOT OF source_database_name
101101
[;]
102102
```
@@ -113,11 +113,11 @@ Any user who can create a database can create a database snapshot; however, to c
113113
For a full description of this syntax, see [CREATE DATABASE (SQL Server Transact-SQL)](../../t-sql/statements/create-database-transact-sql.md#as-snapshot-of-source_database_name).
114114

115115
> [!NOTE]
116-
> When you create a database snapshot, log files, offline files, restoring files, and defunct files are not allowed in the `CREATE DATABASE` statement.
116+
> When you create a database snapshot, log files, offline files, restoring files, and defunct files aren't allowed in the `CREATE DATABASE` statement.
117117
118118
## Examples
119119

120-
The `.ss` extension used in these examples is for convenience, and is not required.
120+
The `.ss` extension used in these examples is for convenience, and isn't required. In databases containing multiple files, all files must be specified, in conformance with the syntax. Filegroups aren't specified.
121121

122122
#### A. Create a snapshot on the AdventureWorks database
123123

@@ -164,13 +164,10 @@ CREATE DATABASE sales_snapshot1200 ON (
164164
GO
165165
```
166166

167-
## See also
167+
## Related content
168168

169169
- [CREATE DATABASE (Transact-SQL)](../../t-sql/statements/create-database-transact-sql.md)
170170
- [Database Snapshots (SQL Server)](database-snapshots-sql-server.md)
171-
172-
## Next steps
173-
174171
- [View a Database Snapshot (SQL Server)](view-a-database-snapshot-sql-server.md)
175172
- [Revert a Database to a Database Snapshot](revert-a-database-to-a-database-snapshot.md)
176173
- [Drop a Database Snapshot (Transact-SQL)](drop-a-database-snapshot-transact-sql.md)

0 commit comments

Comments
 (0)