Solved

MSSQL restore database question

Posted on 2013-06-21
2
530 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

Free Gift Card with Acronis Backup Purchase!

Backup any data in any location: local and remote systems, physical and virtual servers, private and public clouds, Macs and PCs, tablets and mobile devices, & more! For limited time only, buy any Acronis backup products and get a FREE Amazon/Best Buy gift card worth up to $200!

Join & Write a Comment

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

758 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

22 Experts available now in Live!

Get 1:1 Help Now