Solved

MSSQL restore database question

Posted on 2013-06-21
2
531 Views
Last Modified: 2013-06-22
I have a database that due to space constraint, has two logical name (File Type=Rows Data, Filegroup=PRIMARY) and the physical file is located in two separate hard disk.

Now I have a new server with bigger storage capacity. I would like to restore the database into this new server such that the two physical data files is "merged" into one.

Question is, how can this be archived?
0
Comment
Question by:sepknow
2 Comments
 
LVL 23

Accepted Solution

by:
Racim BOUDJAKDJI earned 475 total points
ID: 39267626
Once you restore the database WITH MOVE option, you need to use the DBCC SHRINKFILE instruction with the EMPTYFILE option to force SQL to empty the file you want to get rid off.  SQL will automatically take away the data from the file and put it on the other.  Once ran, all you have to do is drop the file that has been emptied.  More info...

http://technet.microsoft.com/en-us/library/ms189493.aspx

Hope this helps.
0
 
LVL 25

Assisted Solution

by:jogos
jogos earned 25 total points
ID: 39267660
You can  create a new database with the files as you want and then transfer all the objects by using the database copy wizard.   You are talking of a new server, well that can be the way to transfer the database from the old server to the new server.
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now