6

I'm using SQL Server 2012 SP2 to backup my transaction logs directly into Azure Blob Storage using the BACKUP TO URL statement.

I am then attemtpting to verify my transaction log as follows:

RESTORE VERIFYONLY FROM URL = 'https://mystore.blob.core.windows.net/logfile.trn'
WITH CREDENTIAL = 'azurecreds'

The RESTORE VERIFYONLY operation puts a lease on the file in Azure which I can see using Azure Management Studio's blob browser (The last 2 I created without running RESTORE VERIFYONLY).

Azure Management Studio

I can manually break the lease using Azure Management Studio but am I doing something wrong with RESTORE VERIFYONLY that is leaving an active lease on the file?

asked Oct 21, 2015 at 10:48
0

1 Answer 1

3

This seems very similar to:

From that Microsoft Support article:

Symptoms

Assume that you use the RESTORE HEADERONLY or RESTORE FILELISTONLY command to restore a database from Windows Azure Blob storage service in Microsoft SQL Server 2014 or SQL Server 2012. After the command is completed, you cannot remove the backup file.

Cause

The issue occurs because there is an infinite lease on the backup file. Some race conditions between internal threads cause the lease to be not released in some cases.

This is marked as first fixed in Cumulative Update 4 for SQL Server 2012 SP2. While the fix does not mention RESTORE VERIFYONLY explicitly, you should definitely check this out before reporting it as a bug.

The latest Service Pack for SQL Server 2012 at the time of writing is SP3, which will also include the fix mentioned above.

Finally, just to document something GregGalloway originally left in a comment on the question, you can remove active leases using a script in the following MSDN article:

Deleting Backup Blob Files with Active Leases

answered Mar 5, 2016 at 11:59

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.