Solved

MSSQL restore database question

Posted on 2013-06-21
2
535 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 Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

I have a large data set and a SSIS package. How can I load this file in multi threading?
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.

685 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