3

I have DB backup with size approx. 150 Mb.

I am trying to restore it and getting an error: "System.Data.SqlClient.SqlError: There is insufficient free space on disk volume 'C:\' to create the database. The database requires 67771760640 additional free bytes, while only 45085224960 bytes are available. (Microsoft.SqlServer.Smo)"

Restore is about to create DB with much bigger size than backup has. Is there a possibility to reduce size of DB being restored?

asked Jul 16, 2012 at 13:12
3
  • If the backup was compressed, then your actual database may be 67 GB... Commented Jul 16, 2012 at 13:15
  • @JNK, can I somehow find out it backup was compressed? Commented Jul 16, 2012 at 13:18
  • 1
    Use RESTORE HEADERONLY -- there is a column Compressed that will be 0 or 1. Commented Jul 16, 2012 at 13:21

1 Answer 1

5

A restore always restores the files to the same sizes they were when they were backed up.

There is currently no way to "restore with shrink."

You'll need to restore the files to a drive with sufficient free space, and perhaps consider shrinking the files at that point, then use your preferred technique to move the files to the spot you want.

answered Jul 16, 2012 at 13:19
1
  • Alter database + set offline + move files manually + set online is much, much safer than detach + move + attach. Commented Jul 16, 2012 at 13:32

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.