Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2005
»
Administering
»
Restore DB with actual data size
Restore DB with actual data size
Rate Topic
Display Mode
Topic Options
Author
Message
ArjunaReddy
ArjunaReddy
Posted Wednesday, December 05, 2012 2:47 AM
SSC Rookie
Group: General Forum Members
Last Login: Tuesday, May 07, 2013 10:08 PM
Points: 39,
Visits: 388
Hi,
I have a SQL Server database whose data files have been created with an initial size of 150 GB, but it only contains 10 GB of data. A database backup will then be only 21 GB in size. I want to restore this backup to a different server (or a different database on the same server), but I don't want it to take the same disk space as the original one (150GB), which is what happens by default. I can't shrink the original database before taking a backup (it's a production database ), I could shrink the restored database after the restore is done, but I would really prefer to have it not take up 150 GB while doing that; besides, in this specific scenario I don't have that much free disk space on my Lap (machine ), so the restore isn't going anywhere.
Is there any way I can restore the database and have it only take up as much space as the actual data it contains ???
Please address this issue and need your inputs asap... :)
Post #1392862
anthony.green
anthony.green
Posted Wednesday, December 05, 2012 2:58 AM
SSCertifiable
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
No, SQL must restore the database as it was at the time it was backed up, meaning it must create it with a size of 150GB.
The only thing would be to shrink it after restore if you cant shrink the source.
Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1
&
Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger
Post #1392868
Joie Andrew
Joie Andrew
Posted Wednesday, December 05, 2012 8:33 AM
Mr or Mrs. 500
Group: General Forum Members
Last Login: Today @ 3:14 AM
Points: 548,
Visits: 1,026
Do you have enough space on the source server to hold the database twice? If so you could try the following:
- Backup the database you want to put on the destination server
- Restored the database on the source server with a new database name
- Shrink the restored database
- Backup the restored database
- Delete the restored database from the source server
- Copy the backup over
- Restore the backup on the destination server
Joie Andrew
"Since 1982"
Post #1393050
baabhu
baabhu
Posted Friday, December 07, 2012 2:16 AM
Ten Centuries
Group: General Forum Members
Last Login: 2 days ago @ 1:58 AM
Points: 1,112,
Visits: 970
bommaka.nagarjun (12/5/2012)
Hi,
I have a SQL Server database whose data files have been created with an initial size of 150 GB, but it only contains 10 GB of data. A database backup will then be only 21 GB in size. I want to restore this backup to a different server (or a different database on the same server), but I don't want it to take the same disk space as the original one (150GB), which is what happens by default. I can't shrink the original database before taking a backup (it's a production database ), I could shrink the restored database after the restore is done, but I would really prefer to have it not take up 150 GB while doing that; besides, in this specific scenario I don't have that much free disk space on my Lap (machine ), so the restore isn't going anywhere.
Is there any way I can restore the database and have it only take up as much space as the actual data it contains ???
Please address this issue and need your inputs asap... :)
1. Script out all the objects from the source database.
2. Create destination database using the scripts you have. (Don't create the index and other constraints if you have huge data). Looking at 21 GB of data it should be fine with index.
3. BCP out the data from the source server.
4. BCP in the data to the destination server.
This way you would have shrink the database in an effective way.
Post #1393930
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.