Solved

MSSQL restore database question

Posted on 2013-06-21
2
541 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

Question has a verified solution.

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

This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

615 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