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 2000 Forums
 SQL Server Administration (2000)
 Moving a 2 NDF file to different disk location

Author  Topic 

Ericsson
Starting Member

2 Posts

Posted - 2007-01-13 : 20:51:34
Hello

I have huge DB and is on MS Cluster. This DB has 8 Datafiles, here's the breakdown: 1st=.mdf; 6=NDF ; 1=LDF all in F:\ drive location. I have created new disk which is G:\ and created another new datafile which is the 8th NDF.

Is there a way that I can move the 5th/6th Datafile from F:\ to G:\?

Is there any other approach aside from the below that I know:
1) Full Backup and Restore with Move options
2) SP_Detach and move datafiles 5/6th to G:\ then SP_Attach

Thank you in advance for those who will reply.

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2007-01-13 : 22:19:19
the detach/attach is the quickest approach. Before you peform that make sure you have a full backup. You should probably perform a DBCC CHECKDB to make sure there is no corruption. Attaching the database has a bit of risk, since if there is a problem you will not be able to bring the database online. This is why you need to have a good full backup.

Also, note that you need to add the new drive as a dependency to SQL server in your SQL Server cluster group. To be clear, this is not just adding the drive to the cluster group, but modifying the SQL Server resource in the cluster group and adding a new dependency. Otherwise SQL will complain and throw an error when you attempt to bring a database online from that drive letter.



-ec
Go to Top of Page

Ericsson
Starting Member

2 Posts

Posted - 2007-01-14 : 20:16:15
Thanks!

I actually did encountered of what you've mentioned in the SQl cluster resource.... at first I thought that by just creating a resources is enough, but when I tried to use and create another NDF file in that new file, I can not add it, and found out based on the article of MS, it has to be added as part of the dependency of the SQL Server.

So there's really no other way of doing it but just simply detaching/attaching it.
Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2007-01-14 : 20:34:34
backup/restore works too, but attach/detach is faster. I would use the backup/restore method as a seconday solution if the detach/attach has a problem.

be safe with this move though. take a full backup (or two) while the database is in single-user mode. Do a DBCC checkdb and make sure no errors reported. Then take it offline with sp_detach, move the files, then sp_attach and you should be good to go.



-ec
Go to Top of Page
   

- Advertisement -