Solved

Multiple files within the primary file group

Posted on 2008-10-19
3
413 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
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…
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
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

867 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now