Our production database server is backing up its databases nightly to Azure Blob Storage, using the BACKUP TO URL
command in SQL Server 2014 Standard. I'm now attempting to restore those backups to a new SQL Server VM we set up in Azure, which is also running SQL Server 2014 Standard. I'm running the following SQL command:
RESTORE DATABASE Example FROM URL = 'https://exampleaccount.blob.core.windows.net/livedbbackups/ExampleBackup-2015-10-15T01-13-08.bak';
WITH CREDENTIAL = 'AzureBackupCredential',
MOVE 'Example' TO 'C:\Databases\Example.mdf',
MOVE 'Example_log' TO 'C:\Databases\Example.ldf',
STATS = 5;
When I do this, the restore runs for 10+ minutes, and I can see it making progress in the "Messages" window of SQL Server Management Studio. However, right before it gets to 100% done, the following error message is displayed.
Output on Azure VM running Microsoft SQL Server 2014 - 12.0.4213.0 (X64) Standard Edition (64-bit) on Windows NT 6.3 (Build 9600: ) (Hypervisor):
85 percent processed.
90 percent processed.
95 percent processed.
Msg 3013, Level 16, State 1, Line 5
RESTORE DATABASE is terminating abnormally.
Googling for "SQL Server Error 3013" or "SQL Server restore database terminating abnormally" produces a lot of pages suggesting my database file is corrupt. However, I don't think it is, because I can run the exact same SQL on my laptop running SQL Server 2014 Express, and I get the following output:
Output on Laptop running Microsoft SQL Server 2014 - 12.0.2269.0 (X64) Express Edition (64-bit) on Windows NT 6.3 (Build 10240: ) (Hypervisor):
85 percent processed.
90 percent processed.
95 percent processed.
100 percent processed.
Processed 233600 pages for database 'Example', file 'Example' on file 1.
Processed 5 pages for database 'Example', file 'Example_log' on file 1.
RESTORE DATABASE successfully processed 233605 pages in 205.802 seconds (8.867 MB/sec).
Both of these restore statements were run against the exact same URL, with the same unaltered backup file. If it restores correctly on my local copy of SQL Server Express, it can't be corrupt, right?
Here are some other possible causes I tried to rule out:
- Version mismatch - The backup was run on a server running Microsoft SQL Server 2014 - 12.0.2269.0 (X64) Standard Edition (64-bit). The restore was run on a server running Microsoft SQL Server 2014 - 12.0.4213.0 (X64) Standard Edition (64-bit). These version numbers were determined by running
SELECT @@VERSION
on each of the servers. - Perimssions errors - Both
RESTORE HEADERONLY
andRESTORE FILELISTONLY
work correctly on the Azure VM that won't restore the database. - Free space - The C: drive on the Azure VM has more than 80 GB free.
- Network connectivity - I haven't done any extensive testing, but given that the VM running SQL Server is running inside Azure, and the backup file is also in Azure, I imagine it's pretty stable. File downloads and simple tests with the browser seem to indicate that the connection is both stable and fast.
The database in question is about 2 GB when restored, with a 5 GB log file. I have other backups of the same database stored in Azure, and I get the same results when trying to restore any of them (works on local SQL Server Express 2014, fails on Azure VM SQL Server Standard 2014).
Any ideas what might be causing this and how to fix it?