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
@@ -166,7 +166,7 @@ If you use a database in database mirroring or log shipping, both databases are
166
166
> [!TIP]
167
167
> To monitor changes in the TDE status of a database, use SQL Server Audit or SQL Database auditing. For SQL Server, TDE is tracked under the audit action group DATABASE_CHANGE_GROUP, which you can find in [SQL Server Audit Action Groups and Actions](../../../relational-databases/security/auditing/sql-server-audit-action-groups-and-actions.md).
168
168
169
-
###Restrictions
169
+
## Restrictions
170
170
171
171
The following operations are disallowed during initial database encryption, key change, or database decryption:
172
172
@@ -218,7 +218,29 @@ When database files are created, instant file initialization is unavailable when
218
218
219
219
To encrypt a database encryption key with an asymmetric key, the asymmetric key must be on an extensible key-management provider.
220
220
221
-
### Transparent Data Encryption and transaction logs
221
+
## TDE scan
222
+
223
+
To enable TDE on a database, [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] must do an encryption scan. The scan reads each page from the data files into the buffer pool and then writes the encrypted pages back out to disk.
224
+
225
+
To give you more control over the encryption scan, [!INCLUDE[sql-server-2019](../../../includes/sssqlv15-md.md)] introduces TDE scan, which has a suspend and resume syntax. You can pause the scan while the workload on the system is heavy or during business-critical hours and then resume the scan later.
226
+
227
+
Use the following syntax to pause the TDE encryption scan:
228
+
229
+
```sql
230
+
ALTERDATABASE<db_name>SET ENCRYPTION SUSPEND;
231
+
```
232
+
233
+
Similarly, use the following syntax to resume the TDE encryption scan:
234
+
235
+
```sql
236
+
ALTERDATABASE<db_name>SET ENCRYPTION RESUME;
237
+
```
238
+
239
+
The encryption_scan_state column has been added to the sys.dm_database_encryption_keys dynamic management view. It shows the current state of the encryption scan. There's also a new column called encryption_scan_modify_date, which contains the date and time of the last encryption-scan state change.
240
+
241
+
If the [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] instance restarts while its encryption scan is suspended, a message is logged in the error log on startup. The message indicates that an existing scan has been paused.
242
+
243
+
## TDE and transaction logs
222
244
223
245
Letting a database use TDE removes the remaining part of the current virtual transaction log. The removal forces creation of the next transaction log. This behavior guarantees that no clear text is left in the logs after the database is set for encryption.
224
246
@@ -241,51 +263,51 @@ Before a database encryption key changes, the previous database encryption key e
241
263
242
264
If you change a database encryption key twice, you must do a log backup before you can change the database encryption key again.
243
265
244
-
### Transparent Data Encryption and the tempdb system database
266
+
##TDE and the tempdb system database
245
267
246
268
The **tempdb** system database is encrypted if any other database on the [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] instance is encrypted by using TDE. This encryption might have a performance effect for unencrypted databases on the same [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] instance. For more information about the **tempdb** system database, see [tempdb Database](../../../relational-databases/databases/tempdb-database.md).
247
269
248
-
### Transparent Data Encryption and replication
270
+
##TDE and replication
249
271
250
272
Replication doesn't automatically replicate data from a TDE-enabled database in an encrypted form. Separately enable TDE if you want to protect distribution and subscriber databases.
251
273
252
274
Snapshot replication can store data in unencrypted intermediate files like BCP files. The initial data distribution for transactional and merge replication can too. During such replication, you can enable encryption to protect the communication channel.
253
275
254
276
For more information, see [Enable Encrypted Connections to the Database Engine (SQL Server Configuration Manager)](../../../database-engine/configure-windows/enable-encrypted-connections-to-the-database-engine.md).
255
277
256
-
### Transparent Data Encryption and FILESTREAM data
278
+
## TDE and Always On
279
+
You can [add an encrypted database to an Always On availability group](../../../database-engine/availability-groups/windows/encrypted-databases-with-always-on-availability-groups-sql-server.md).
257
280
258
-
**FILESTREAM** data isn't encrypted even when you enable TDE.
281
+
To encrypt databases that are part of an availability group, create the master key and certificates, or asymmetric key (EKM) on all secondary replicas before creating the [database encryption key](../../../t-sql/statements/create-database-encryption-key-transact-sql.md) on the primary replica.
259
282
260
-
<aname="scan-suspend-resume"></a>
283
+
If a certificate is used to protect the database encryption key (DEK), [back up the certificate](../../../t-sql/statements/backup-certificate-transact-sql.md) created on the primary replica, and then [create the certificate from a file](../../../t-sql/statements/create-certificate-transact-sql.md) on all secondary replicas before creating the database encryption key on the primary replica.
261
284
262
-
## Transparent Data Encryption scan
285
+
## TDE and FILESTREAM data
263
286
264
-
To enable TDE on a database, [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] must do an encryption scan. The scan reads each page from the data files into the buffer pool and then writes the encrypted pages back out to disk.
287
+
**FILESTREAM**data isn't encrypted even when you enable TDE.
265
288
266
-
To give you more control over the encryption scan, [!INCLUDE[sql-server-2019](../../../includes/sssqlv15-md.md)] introduces TDE scan, which has a suspend and resume syntax. You can pause the scan while the workload on the system is heavy or during business-critical hours and then resume the scan later.
289
+
<aname="scan-suspend-resume"></a>
267
290
268
-
Use the following syntax to pause the TDE encryption scan:
291
+
## Remove TDE
269
292
270
-
```sql
271
-
ALTERDATABASE<db_name>SET ENCRYPTION SUSPEND;
272
-
```
273
-
274
-
Similarly, use the following syntax to resume the TDE encryption scan:
293
+
Remove encryption from the database by using the `ALTER DATABASE` statement.
275
294
276
295
```sql
277
-
ALTERDATABASE<db_name>SET ENCRYPTION RESUME;
296
+
ALTERDATABASE<db_name>SET ENCRYPTION OFF;
278
297
```
279
298
280
-
The encryption_scan_state column has been added to the sys.dm_database_encryption_keys dynamic management view. It shows the current state of the encryption scan. There's also a new column called encryption_scan_modify_date, which contains the date and time of the last encryption-scan state change.
299
+
To viewthe state of the database, use the [sys.dm_database_encryption_keys](../../../relational-databases/system-dynamic-management-views/sys-dm-database-encryption-keys-transact-sql.md) dynamic management view.
281
300
282
-
If the [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] instance restarts while its encryption scan is suspended, a message is logged in the error log on startup. The message indicates that an existing scan has been paused.
301
+
Wait for decryption to finish before removing the database encryption key by using [DROP DATABASE ENCRYPTION KEY](../../../t-sql/statements/drop-database-encryption-key-transact-sql.md).
302
+
303
+
> [!IMPORTANT]
304
+
> Back up the master key and certificate that are used for TDE to a safe location. The master key and certificate are required to restore backups that were taken when the database was encrypted with TDE. After you remove the database encryption key, take a log backup followed by a fresh full backup of the decrypted database.
283
305
284
-
## Transparent Data Encryption and buffer pool extension
306
+
## TDE and buffer pool extension
285
307
286
308
When you encrypt a database using TDE, files related to buffer pool extension (BPE) aren't encrypted. For those files, use encryption tools like BitLocker or EFS at the file-system level.
287
309
288
-
## Transparent Data Encryption and In-Memory OLTP
310
+
## TDE and In-Memory OLTP
289
311
290
312
You can enable TDE on a database that has In-Memory OLTP objects. In [!INCLUDE[ssSQL15](../../../includes/sssql15-md.md)] and [!INCLUDE[ssSDSfull](../../../includes/sssdsfull-md.md)], In-Memory OLTP log records and data are encrypted if you enable TDE. In [!INCLUDE[ssSQL14](../../../includes/sssql14-md.md)], In-Memory OLTP log records are encrypted if you enable TDE, but files in the MEMORY_OPTIMIZED_DATA filegroup are unencrypted.
0 commit comments