Solved

Multiple files within the primary file group

Posted on 2008-10-19
3
416 Views
Last Modified: 2012-06-22
Hi All,

Is it possible to take a backup of a database that has multiple files within the primary file group (2 total in this example)

and restore that backup to a new database that has only one file in the primary file group?

Note I am talking about 2 FILES in 1 Filegroup not Multipule file groups!

This is on SQL 2000
0
Comment
Question by:TAB8
[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
3 Comments
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22753645
no. the restore will restore the same files as in the original database as it was backed up.
0
 
LVL 10

Author Comment

by:TAB8
ID: 22753706
How can I then after the restore combine the two files into one file ..

Do i have to create a new secondary filegroup with a seperate file
Move all  object to the new file group
Make the new file group the primary
then remove the old file group with the 2 empty files

THis just seems like a long process for a simple taks ?
 
0
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 22753822
that scenario would work, but not for the PRIMARY filegroup which cannot be deleted/renamed.

what you need to do is use the DBCC SHRINKFILE command with the EMPTYFILE option.
that will move all the data from that file to the other file(s) of it's filegroup, and after that you can drop the file.

msdn.microsoft.com/en-us/library/ms189493.aspx
0

Featured Post

The Ultimate Checklist to Optimize Your Website

Websites are getting bigger and complicated by the day. Video, images, custom fonts are all great for showcasing your product/service. But the price to pay in terms of reduced page load times and ultimately, decreased sales, can lead to some difficult decisions about what to cut.

Question has a verified solution.

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

In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

705 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