SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Moving a 2 NDF file to different disk location
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Ericsson
Starting Member

Singapore
2 Posts

Posted - 01/13/2007 :  20:51:34  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
3575 Posts

Posted - 01/13/2007 :  22:19:19  Show Profile  Reply with Quote
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

Singapore
2 Posts

Posted - 01/14/2007 :  20:16:15  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

USA
3575 Posts

Posted - 01/14/2007 :  20:34:34  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000