Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Any way to split large .mdf files?

Author  Topic 

vinceseg
Starting Member

1 Post

Posted - 2012-11-09 : 09:08:59
I have a database that is currently 1900GB and we normally use filegroups and smaller mount points (500GB or 1TB) for SAN performance purposes.

Is there a way to take this large mdf file and "split it into a new database with multiple filegroups?

My only other option (since this will be on VMware) is to utilize RDM's but I'd prefer not to go that route since we're also looking to utilize VMware's DR product, and RDM's are a real pain.

Thanks,

Vince

chadmat
The Chadinator

1974 Posts

Posted - 2012-11-09 : 12:42:28
Why can't you just move to multiple files/filegroups?

-Chad
Go to Top of Page

srimami
Posting Yak Master

160 Posts

Posted - 2012-11-20 : 09:50:05
This depends on how many tables you have in the database. If you have only 1 table of huge size, you can create a filegroup with multiple files to this filegroup and move the data from primary to secondary filegroup (You an use create Index idx_name with Move syntax). If you have multiple tables and need to move the data to multiple files then move each table to a new file group/files independently.
Go to Top of Page

prett
Posting Yak Master

212 Posts

Posted - 2012-11-21 : 23:14:43
you can create additional database files and force the SQL Server to move data from the primary database file to the secondary database files.

use SSMS to connect to the SQL Server, click on the database, display property page, select Files and than add additional data files using .ndf extensions specifying max file size less than the size of the drives.

After adding the additional files, click on the server and open the context menu and select Task -> Shrink > Data Files and shrink the larger primary database file (.mdf) to a size smaller than the destination drive.

the process of moving data takes a long time.

the process is also described here: http://msdn.microsoft.com/en-us/library/ms189253.aspx and http://msdn.microsoft.com/en-us/library/ms190757.aspx
Go to Top of Page
   

- Advertisement -