Filegroup Issue | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

Filegroup Issue

Hi ,
I am trying to restore a backup that was sent to me. When i try to restore it, shows me around 40 ldf’s,3 ldf’s and three different file groups. I have two questions —> how to reduce the number files without loosing the data.
—> I needs all the ndf’s to be under the PRIMARY file group. How to do this? Please advise. Thanks
Roopa
You will have to restore the fileset as present in the backup file (also same size !!)
You can however put the files at the location you want! You’ll get the overview with :
Restore headeronly from disk=’drive:yourbackupfile’ This will give you an overview of logical filenames and their path. Restore database yourdbname_restore
from disk = ‘drive:yourbackupfile’
with move logicalfilename1 to ‘yournewpath and filename1’,
move logicalfilename2 to ‘yournewpath and filename2’,
….
, recovery Check restore database in BOL.
http://sqljunkies.com/HowTo/B9F7F302-964A-4825-9246-6143A8681900.scuk move tables between filegroups. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
quote:Originally posted by roopaprp Hi ,
I am trying to restore a backup that was sent to me. When i try to restore it, shows me around 40 ldf’s,3 ldf’s and three different file groups. I have two questions —> how to reduce the number files without loosing the data.
—> I needs all the ndf’s to be under the PRIMARY file group. How to do this? Please advise. Thanks
Roopa
First you have to restore the backup as is… you can change it while restoring…
Once the backup is restored you have to follow the link provided by Satya…
MohammedU.
Moderator
SQL-Server-Performance.com All postings are provided “AS IS” with no warranties for accuracy.

The link provides details for SQL Server 2000. How can we change the filegroup of a table in SQL Server 2005? I also have an issue in removing a filegroup in SQL Srever 2000. I created a filegroup SECONDARY then add a file named DATA2 in this filegroup. then placed a table in new file DATA2. Now I am unable to empty the file DATA2 and therefore unable to remove the filegroup SECONDARY. Please advise. Thanks. Regards,
Subhash
Still most of it applicable to SQL 2005 too, also refer tohttp://www.mssqltips.com/tip.asp?tip=1112 link. Satya SKJ
Microsoft SQL Server MVP
Writer, Contributing Editor & Moderator
http://www.SQL-Server-Performance.Com
This posting is provided AS IS with no rights for the sake of knowledge sharing. Knowledge is of two kinds. We know a subject ourselves or we know where we can find information on it.
]]>