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.
| Author |
Topic |
|
sanjay kumar
Starting Member
7 Posts |
Posted - 2011-05-04 : 05:41:24
|
| Hello all,I've a secondary file(.ndf) in D: drive, and for some reason that drive is full. and the .mdf and .ldf files are in other drive.So, now i want to move the .ndf file from D: to other drive, like G: drive,What is the procedure to move the secondary files from one drive to other.Plz. help me |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-05-04 : 05:45:46
|
| I would backup then restore with a move on that file after a test restore on another server to make sure the backup is ok.Depends on how important the database is and how much downtime you can allow.==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
sanjay kumar
Starting Member
7 Posts |
Posted - 2011-05-04 : 05:54:24
|
| Thanx for your kind support,Like we move the system databases by executing the query ALTER DATABASE [DATABASENAME] MODIFY FILE (NAME='---', FILENAME='--'),like this manner can't i move the secondary(.ndf) file to other drive? |
 |
|
|
lionofdezert
Aged Yak Warrior
885 Posts |
Posted - 2011-05-04 : 06:14:50
|
| Detach your database --- move files to new locations -- attach your database by mentioning file path from new locations--------------------------http://connectsql.blogspot.com/ |
 |
|
|
nigelrivett
Master Smack Fu Yak Hacker
3385 Posts |
Posted - 2011-05-04 : 06:31:15
|
| I would do a backup before that - and given that you have a backup you might as well use it for the restore.==========================================Cursors are useful if you don't know sql.SSIS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
sanjay kumar
Starting Member
7 Posts |
Posted - 2011-05-04 : 06:40:09
|
| Thank you all for your kind support... |
 |
|
|
GilaMonster
Master Smack Fu Yak Hacker
4507 Posts |
Posted - 2011-05-04 : 07:56:49
|
| Yes, you can use Alter DAtabase to move the user database files.Run the alter databaseTake the DB offlinePhysically move the filesBring the DB back online.--Gail ShawSQL Server MVP |
 |
|
|
|
|
|