Solved

Multiple files within the primary file group

Posted on 2008-10-19
3
414 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
  • 2
3 Comments
 
LVL 142

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 142

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
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 extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

825 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