question

shamim007 avatar image
shamim007 asked

Detach and attach Database

Hi ALL currently i have to move some MDF AND NDF files from one drive to another drive ,what is the best practice to do that ,taking database OFFLINE or Detaching database from SSMS ? thanks
sql-server-2008database-files
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
JohnM avatar image
JohnM answered
I would update the location of the files for the database first, then take it offline, copythe files and bring it back online. I would copy the files rather than move them. This would allow you to revert back to the original files in the event of an issue during the copy process. Once the database is back online, you can then remove the old files. Here is some documentation that describes how to accomplish this: https://technet.microsoft.com/en-us/library/gg452698.aspx http://dba.stackexchange.com/questions/52007/how-do-i-move-sql-server-database-files I would NOT detach/attach it. Once you detach it you are very limited to what you can do with it in the event of a problem.
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

shamim007 avatar image shamim007 commented ·
thank yous o much .i like your ideas .i will follow you .@JohnM
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.