• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

Move MDF to larger volume?

Hello all.

I'm looking for a way to move an .mdf to a larger volume. After a couple years, shrink isn't giving me any extra space. After running EXEC sp_spaceused, I see that there isn't any unallocated space left and it has gotten too big for the existing volume.

Thanks in advance.

Edit: Not sure why it says I'm a guru in this subject. Obviously I'm not :)
0
robbcharlton
Asked:
robbcharlton
  • 3
  • 2
  • 2
1 Solution
 
chapmandewCommented:
you'll need to detach the database, move the file to where you need it, and then attach the file.
0
 
robbcharltonAuthor Commented:
Lol, I thought so, but it seemed too easy a solution to me. Thanks again!
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
Alternatively...(to avoid bringing the db down for a long copy time)

> Create a new db with files on new drive using a full backup on current db.  Name that db DB1_NEW
> Migrate all users from DB1 to DB1_NEW
> Rename DB1 to DB1_OLD and DB1_NEW to DB1
> Done (when you feel safe and finished testing drop DB1_OLD)....

HTH
0
 
robbcharltonAuthor Commented:
Thanks for the add'l info. Chapmandew's instructions did the trick.
0
 
Racim BOUDJAKDJIDatabase Architect - Dba - Data ScientistCommented:
<<Chapmandew's instructions did the trick.>>

That's fine...sp_detachdb is a nice way to do it on regular db's...I wish I had the luxury of sp_detachdb on my 150Gb files and have my clients accept the file copy downtime ....
0
 
robbcharltonAuthor Commented:
Yeah, my file wasn't quite that big. I just told my users to find something else to do for 30 minutes.

Thanks again for all the feedback.
0

Featured Post

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

  • 3
  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now