FIX: Slow metadata RESTORE performance and incomplete orphaned backup files on Microsoft Azure Blob storage when backup fails in SQL 2012

Applies to: SQL Server 2012 EnterpriseSQL Server 2012 Business IntelligenceSQL Server 2012 Developer

Microsoft SQL Server 2012 Service Pack 1 fixes are distributed as one downloadable file. Given that the fixes are cumulative, each new release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 Service Pack 1 fix release.

Symptoms


Issue 1
Assume that you run one of the following statements to restore a database from the Microsoft Azure Blob storage service:
  • RESTORE HEADERONLY
  • RESTORE FILELISTONLY
  • RESTORE LABELONLY
In this situation, the performance of the operations may be much slower than expected.

Issue 2
Assume that when you back up a database on Microsoft Azure Blob storage, some errors occur and the backup operation is exited unexpectedly.

In this situation, incomplete backup files may be written to the Microsoft Azure Blob storage. Additionally, when you use the incomplete files to restore the database, you receive the following error message:

Msg 3203, Level 16, State 1, Line 1
Read on "URL" failed: Backup to URL received an exception from the remote endpoint. Exception Message: The remote server returned an error: (409) Conflict.

Msg 3013, Level 16, State 1, Line 1
RESTORE FILELIST is terminating abnormally.

Resolution


After you apply this update, SQL Server tries to remove the incomplete backup file that Backup operation was writing against. If Backup operation cannot regain access to the incomplete backup file, such as when the operation is in long term or perpetual disconnect, the file may remain orphaned. In this case, you have to manually remove the lease on the backup file and delete the backup file. For more information, see Deleting Backup Blob Files with Active Leases

Cumulative update information

Cumulative Update 4 for SQL Server 2012 SP1

The fix for this issue was first released in Cumulative Update 4. For more information about how to obtain this cumulative update package for SQL Server 2012 SP1, click the following article number to go to the article in the Microsoft Knowledge Base:
2833645 Cumulative update 4 for SQL Server 2012 SP1
Note Given that the builds are cumulative, each new fix release contains all the hotfixes and all the security fixes that were included with the previous SQL Server 2012 SP1 fix release. We recommend that you consider applying the most recent fix release that contains this hotfix. For more information, click the following article number to go to the article in the Microsoft Knowledge Base:
2772858 The SQL Server 2012 builds that were released after SQL Server 2012 Service Pack 1 was released

Status


Microsoft has confirmed that this is a problem in the Microsoft products that are listed in the "Applies to" section.

References


For more information about SQL Server backup and restore on Microsoft Azure Blob storage, go to the following MSDN blog: For more information about the Incremental Servicing Model for SQL Server, click the following article number to go to the article in the Microsoft Knowledge Base:
935897 An Incremental Servicing Model is available from the SQL Server team to deliver hotfixes for reported problems
For more information about the naming schema for SQL Server updates, click the following article number to go to the article in the Microsoft Knowledge Base:
822499 Naming schema for Microsoft SQL Server software update packages
For more information about software update terminology, click the following article number to go to the article in the Microsoft Knowledge Base:
824684 Description of the standard terminology that is used to describe Microsoft software updates