Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MSSQL restore database question

Posted on 2013-06-21
2
Medium Priority
?
545 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 1900 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 100 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

Moving data to the cloud? Find out if you’re ready

Before moving to the cloud, it is important to carefully define your db needs, plan for the migration & understand prod. environment. This wp explains how to define what you need from a cloud provider, plan for the migration & what putting a cloud solution into practice entails.

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
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.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties

688 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