Home All Groups Group Topic Archive Search About

Adding a new datafile

Author
21 Jul 2006 4:29 PM
Federico G. Babelis
Hi:



I have SQL Server 2000; a database with three file groups located in three
different operating system files; the database size is 200GB; for
performance reasons we added an additional storage to the server and we have
an additional disk volume, what we want to do is to add a new datafile
(datafile4) and then use any command or procedure to equally split database
information (data) among the four datafiles.



How this split can be safely performed ?

Any idea or procedure ?



Thanks and best regards,

Federico

Author
21 Jul 2006 10:03 PM
Erland Sommarskog
Federico G. Babelis (feder***@gazum.com) writes:
> I have SQL Server 2000; a database with three file groups located in
> three different operating system files; the database size is 200GB; for
> performance reasons we added an additional storage to the server and we
> have an additional disk volume, what we want to do is to add a new
> datafile (datafile4) and then use any command or procedure to equally
> split database information (data) among the four datafiles.

One way is to create a new filegroup, and then explicitly move tables and
indexes to the new filegroup with CREATE INDEX ON ... WITH DROP_EXISTING.

If you want to add the file to an existing filegroup, I don't think
there is a way to explicitly move the data, but if you run DBCC DBREINDEX
on some table, I guess the data will be moved around.


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button