Casper
Casper

Reputation: 1723

Unable to restore SQL Server bak file from S3, says file too large

I'm trying to run a restore query from a bak file stored in S3 bucket to an RDS SQL Server Web edition, and kept getting this error:

[2017-09-13 20:30:22.227] Aborted the task because of a task failure or a concurrent RESTORE_DB request. [2017-09-13 20:30:22.287] There is not enough space on the disk to perform restore database operaton.

The bak file is 77 GB and the DB has 2TB, how come this is still not enough?

This is the query from AWS docs:

exec msdb.dbo.rds_restore_database 
        @restore_db_name='database_name', 
        @s3_arn_to_restore_from='arn:aws:s3:::bucket_name/file_name_and_extension';

Source: http://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/SQLServer.Procedural.Importing.html#SQLServer.Procedural.Importing.Native.Using

Upvotes: 4

Views: 6244

Answers (1)

sepupic
sepupic

Reputation: 8687

There is not enough space on the disk to perform restore database operaton.

...

The bak file is 77 GB and the DB has 2TB, how come this is still not enough?

You need 2Tb of space to be able to restore this backup.

The fact is that restore operation will reconstruct your original database that is 2Tb.

Backup is backing up only data, not empty space. If your backup is only 77Gb and is not compressed this means that your original database has only 77Gb of data (or even less, because backup contains a certain amout of log as well).

Any database consists of data file(s) and log file(s), and if your db is about 2Tb with only 77Gb of data, it means it has enormous log file. I think it's in full recovery model and someone does not take regular log backups (or even did not take any log backup at all!!)

So you should take a look at your original db, change recovery model to simple if you don't need point in time recovery and take no log backups, or, if you really need full recovery model, you should backup log more frequently.

Taking regular log backups or changing recovery model to simple will permit you to shrink the log to reasonable size, from that moment you will not need 2Gb of space to restore it anymore

Upvotes: 6

Related Questions