|
1 | 1 | --- |
2 | 2 | title: "BACKUP (Transact-SQL) | Microsoft Docs" |
3 | 3 | ms.custom: "" |
4 | | -ms.date: 06/11/2020 |
| 4 | +ms.date: "06/11/2020" |
5 | 5 | ms.prod: sql |
6 | 6 | ms.prod_service: "sql-database" |
7 | 7 | ms.reviewer: "" |
@@ -481,15 +481,8 @@ Specifies the largest unit of transfer in bytes to be used between [!INCLUDE[ssN |
481 | 481 | > When creating backups by using the SQL Writer Service, if the database has configured [FILESTREAM](../../relational-databases/blob/filestream-sql-server.md), or includes [memory optimized filegroups](../../relational-databases/in-memory-oltp/the-memory-optimized-filegroup.md), then the `MAXTRANSFERSIZE` at the time of a restore should be greater than or equal to the `MAXTRANSFERSIZE` that was used when the backup was created. |
482 | 482 |
|
483 | 483 | > [!NOTE] |
484 | | -> For [Transparent Data Encryption (TDE)](../../relational-databases/security/encryption/transparent-data-encryption.md) enabled databases with a single data file, the default `MAXTRANSFERSIZE` is 65536 (64 KB). Starting with SQL Server 2016 (13.x), this enables an optimized compression algorithm for TDE encrypted databases that first decrypts a page, compresses it and then encrypts it again. If using MAXTRANSFERSIZE = 65536 (64 KB), backup compression with TDE encrypted databases directly compresses the encrypted pages, and may not yield good compression ratios. |
485 | | -> |
486 | | -> SQL Server 2019 CU5 and later no longer require a specific MAXTRANSFERSIZE for optimal compression ratios. |
487 | | -> |
488 | | ->For more information, see [Backup Compression for TDE-enabled Databases](https://docs.microsoft.com/archive/blogs/sqlcat/sqlsweet16-episode-1-backup-compression-for-tde-enabled-databases). |
489 | | -> |
490 | | ->For non-TDE encrypted databases the default `MAXTRANSFERSIZE` is 1048576 (1 MB) when using backup to DISK, and 65536 (64 KB) when using VDI or TAPE. |
491 | | -> |
492 | | ->For more information about using backup compression with TDE encrypted databases, see the [Remarks](#general-remarks) section. |
| 484 | +> For [Transparent Data Encryption (TDE)](../../relational-databases/security/encryption/transparent-data-encryption.md) enabled databases with a single data file, the default `MAXTRANSFERSIZE` is 65536 (64 KB). For non-TDE encrypted databases the default `MAXTRANSFERSIZE` is 1048576 (1 MB) when using backup to DISK, and 65536 (64 KB) when using VDI or TAPE. |
| 485 | +> For more information about using backup compression with TDE encrypted databases, see the [Remarks](#general-remarks) section. |
493 | 486 |
|
494 | 487 | **Error Management Options** |
495 | 488 |
|
@@ -745,16 +738,17 @@ The BACKUP statement is not allowed in an explicit or implicit transaction. |
745 | 738 |
|
746 | 739 | Cross-platform backup operations, even between different processor types, can be performed as long as the collation of the database is supported by the operating system. |
747 | 740 |
|
748 | | -When using backup compression with [Transparent Data Encryption (TDE)](../../relational-databases/security/encryption/transparent-data-encryption.md) enabled databases with a single data file, it is recommended to use a `MAXTRANSFERSIZE` setting **larger than 65536 (64 KB)**. |
749 | | -Starting with [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)], this enables an optimized compression algorithm for TDE encrypted databases that first decrypts a page, compresses it and then encrypts it again. If using `MAXTRANSFERSIZE = 65536` (64 KB), backup compression with TDE encrypted databases directly compresses the encrypted pages, and may not yield good compression ratios. For more information, see [Backup Compression for TDE-enabled Databases](https://blogs.msdn.microsoft.com/sqlcat/2016/06/20/sqlsweet16-episode-1-backup-compression-for-tde-enabled-databases/). |
| 741 | +Starting with [!INCLUDE[ssSQL15](../../includes/sssql15-md.md)], setting `MAXTRANSFERSIZE` **larger than 65536 (64 KB)** enables an optimized compression algorithm for [Transparent Data Encryption (TDE)](../../relational-databases/security/encryption/transparent-data-encryption.md) encrypted databases that first decrypts a page, compresses it, and then encrypts it again. If `MAXTRANSFERSIZE` is not specified, or if `MAXTRANSFERSIZE = 65536` (64 KB) is used, backup compression with TDE encrypted databases directly compresses the encrypted pages, and may not yield good compression ratios. For more information, see [Backup Compression for TDE-enabled Databases](https://blogs.msdn.microsoft.com/sqlcat/2016/06/20/sqlsweet16-episode-1-backup-compression-for-tde-enabled-databases/). |
| 742 | + |
| 743 | +Starting with [!INCLUDE[sql-server-2019](../../includes/sssqlv15-md.md)] CU5, setting `MAXTRANSFERSIZE` is no longer required to enable this optimized compression algorithm with TDE. If the backup command is specified `WITH COMPRESSION` or the *backup compression default* server configuration is set to 1, `MAXTRANSFERSIZE` will automatically be increased to 128K to enable the optimized algorithm. If `MAXTRANSFERSIZE` is specified on the backup command with a value > 64K, the provided value will be honored. In other words, SQL Server will never automatically decrease the value, it will only increase it. If you need to back up a TDE encrypted database with `MAXTRANSFERSIZE = 65536`, you must specify `WITH NO_COMPRESSION` or ensure that the *backup compression default* server configuration is set to 0. |
750 | 744 |
|
751 | 745 | > [!NOTE] |
752 | 746 | > There are some cases where the default `MAXTRANSFERSIZE` is greater than 64K: |
753 | 747 | > |
754 | 748 | > - When the database has multiple data files created, it uses `MAXTRANSFERSIZE` > 64K |
755 | 749 | > - When performing backup to URL, the default `MAXTRANSFERSIZE = 1048576` (1MB) |
756 | 750 | > |
757 | | -> Even if one of these conditions applies, you must explicitly set `MAXTRANSFERSIZE` greater than 64K in your backup command in order to get the new backup compression algorithm. |
| 751 | +> Even if one of these conditions applies, you must explicitly set `MAXTRANSFERSIZE` greater than 64K in your backup command in order to get the optimized backup compression algorithm, unless you are on [!INCLUDE[sql-server-2019](../../includes/sssqlv15-md.md)] CU5 or later. |
758 | 752 |
|
759 | 753 | By default, every successful backup operation adds an entry in the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] error log and in the system event log. If back up the log very frequently, these success messages accumulate quickly, resulting in huge error logs that can make finding other messages difficult. In such cases you can suppress these log entries by using trace flag 3226 if none of your scripts depend on those entries. For more information, see [Trace Flags](../../t-sql/database-console-commands/dbcc-traceon-trace-flags-transact-sql.md). |
760 | 754 |
|
|
0 commit comments