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
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.
19
19
20
20
## Prerequisites
21
21
22
22
The source database, which can use any recovery model, must meet the following prerequisites:
23
23
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).
25
25
26
26
- The source database must be online, unless the database is a mirror database within a database mirroring session.
27
27
28
28
- 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).
29
29
30
30
- The source database can't be configured as a scalable shared database.
31
31
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)].
33
33
34
34
> [!IMPORTANT]
35
35
> 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:
44
44
45
45
#### <aid="naming"></a> Best practice: naming database snapshots
46
46
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:
48
48
49
49
- The name of the source database.
50
50
51
51
- An indication that the new name is for a snapshot.
52
52
53
53
- 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.
54
54
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:
#### <aid="limiting-number"></a> Best practice: limiting the number of database snapshots
72
72
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.
74
74
75
75
> [!NOTE]
76
76
> To revert to a database snapshot, you need to delete any other snapshots from that database.
77
77
78
78
#### <aid="client-connections"></a> Best practice: client connections to a database snapshot
79
79
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.
81
81
82
82
## Permissions
83
83
@@ -96,7 +96,7 @@ Any user who can create a database can create a database snapshot; however, to c
96
96
NAME = logical_file_name
97
97
, FILENAME = 'os_file_name'
98
98
) [ , ...n ]
99
-
99
+
100
100
AS SNAPSHOT OF source_database_name
101
101
[;]
102
102
```
@@ -113,11 +113,11 @@ Any user who can create a database can create a database snapshot; however, to c
113
113
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).
114
114
115
115
> [!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.
117
117
118
118
## Examples
119
119
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.
121
121
122
122
#### A. Create a snapshot on the AdventureWorks database
123
123
@@ -164,13 +164,10 @@ CREATE DATABASE sales_snapshot1200 ON (
0 commit comments