Wednesday, March 28, 2012

Resize Filegroups Allocation on restore

Hi, I have a database with about 200Gigs allocated to filegroups and 200Megs data in it presently, and am trying to create a copy of the database on the same server - except I don't have enough diskspace free for another 200Gigs. Is there a way using copy database wizard, or restore that the filegroup allocations can be resized?

Thanks,
Chris

Unfortunately, no.

Backup copies physical blocks and puts them back in the same place that they came from.

Even if your database is only using 200MB out of 200GB, there is no assurance that the 200MB is nicely located in the front of the data files.

Your options are:

If the source database doesn't need to be that big, you can run DBCC SHRINKDATABASE on it and then back it up, or you can temporarily restore the database on a 3rd machine, run SHRINKDATABASE on it, back it up, and take it to your smaller machine.

No comments:

Post a Comment