PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > FileGroup questions
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
FileGroup questions

Réponse
 
LinkBack Outils de la discussion
Vieux 20/05/2008, 21h17   #1
Jim Reed
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut FileGroup questions

I have a very large database with about 20 filegroups. We want to consolidate
down to 3 or 4 file groups. My question is how can we do that in TSQL? I am
trying to do it during a restore but have not found a good solution. I can
create the filegroups and new files but have not found a way to attach the
existing files to the new filegroups.
  Réponse avec citation
Vieux 21/05/2008, 01h58   #2
Dan Guzman
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: FileGroup questions

You'll need to move objects to the filegroups you want to retain. You can
accomplish this in SQL Server 2005 with ALTER INDEX, ALTER TABLE or CREATE
INDEX...WITH DROP EXISTING. Delete the empty files/filegroups afterward.

--
Hope this s.

Dan Guzman
SQL Server MVP
http://weblogs.sqlteam.com/dang/

"Jim Reed" <JimReed@discussions.microsoft.com> wrote in message
news:2717BB51-FC86-4635-817B-344E999F2BE2@microsoft.com...
>I have a very large database with about 20 filegroups. We want to
>consolidate
> down to 3 or 4 file groups. My question is how can we do that in TSQL? I
> am
> trying to do it during a restore but have not found a good solution. I can
> create the filegroups and new files but have not found a way to attach the
> existing files to the new filegroups.


  Réponse avec citation
Vieux 23/06/2008, 23h12   #3
John Sansom
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: FileGroup questions

Hi,

As Dan suggests, you are going to have to do this the manually.

May I recommend that before you go ahead and make the changes, that you
restore a copy of your production database to a test server. You can then
create and test scripts required in order to conduct your migration. Often in
order to move tables you will need to drop constraints beforehand, and then
re-apply them afterward so your migration is going to require some careful
planning.

One thing to watch out for is if you have tables with BLOB data such as the
image data type, moving the clustered index, will not work as the data is
stored separately from the table and index data itself. In order to move
these types of tables you will need to create a new table in the target
filegroup and populate it manually. If you script out the create statements
for tables of this type you will see that the binary data has it’s own
Filegroup assignment statement and hence the data is stored independently of
the table data.

Hope this makes sense, good luck with your project and be sure to let me
know if I can be of any further assistance.

Remember, careful planning is the key to a successful project.

Best Regards,
John Sansom


"Dan Guzman" wrote:

> You'll need to move objects to the filegroups you want to retain. You can
> accomplish this in SQL Server 2005 with ALTER INDEX, ALTER TABLE or CREATE
> INDEX...WITH DROP EXISTING. Delete the empty files/filegroups afterward.
>
> --
> Hope this s.
>
> Dan Guzman
> SQL Server MVP
> http://weblogs.sqlteam.com/dang/
>
> "Jim Reed" <JimReed@discussions.microsoft.com> wrote in message
> news:2717BB51-FC86-4635-817B-344E999F2BE2@microsoft.com...
> >I have a very large database with about 20 filegroups. We want to
> >consolidate
> > down to 3 or 4 file groups. My question is how can we do that in TSQL? I
> > am
> > trying to do it during a restore but have not found a good solution. I can
> > create the filegroups and new files but have not found a way to attach the
> > existing files to the new filegroups.

>

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h44.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,11997 seconds with 11 queries