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 2005 Forums
 High Availability (2005)
 Moving .SQL data files

Author  Topic 

dturner
Starting Member

24 Posts

Posted - 2007-01-02 : 13:58:11
I have a database with split .mdf files.

As it grew, the previous admin split the database files between two drives. I now have to move it to a new, third drive and would like to re-integrate them into one.

Is there anyone who knows the best way to do this?

The world has more information to offer than I can hold in my head

So
I have the following

P:\data\myfile1_Data.MDF
S:\data\myfile2_Data.mdf

I want to move both file into one to my new SAN

F:\data\myfile_Data.MDF

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2007-01-02 : 14:49:55
You would use detach/attach method to move the data files to the new server. You'd then need to move the data around by recreating the tables on the primary filegroup.

Tara Kizer
Go to Top of Page

jen
Master Smack Fu Yak Hacker

4110 Posts

Posted - 2007-02-09 : 18:12:12
2 mdf files? or a typo? anyways here's how i do it...

restore the backup in another database - option A (lots of work but i prefer this)

or perform directly on the actual db - option B

check which tables/objects are on the ndf, if objects just recreate on the primary

if tables, create or recreate a clustered index on the primary, this moves the table to the primary (mdf)... check if the other objects like non-clustered indexes, etc, were moved as well... otherwise just re-create

then remove the ndf... check bol for alter database on removing files

then make a backup and restore on actual database if you did it with option A

--------------------
keeping it simple...
Go to Top of Page
   

- Advertisement -