Move Database to different Partition

  • Hello everyone,

    I installed SQL Server 2005 with the default setting, later I realized I did want this, I want to move database to the D:/ partition and logs on a E: partition, how do I do this your help will be greatly appreciated.

    Jack

  • detach the databases, copy the mdf/ldf files over, and reattach the database.

    Right click in SSMS will give you the detach/attach options.

  • Hi jass,

    I think this link may help you .....

    http://support.microsoft.com/kb/224071

    ---

  • Are you talking user databases or System databases?

    Because System Databases cannot be detached while SQL Server Service is running. You'll have to use the Alter Database command (see Books Online) to change their location, stop the service, and copy the databases over before restarting the service.

    Of course, TempDB, you just use the Alter Database command and don't worry about copying. It'll start up on the new partition just fine. (Or should).

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • Brandie Tarvin (1/28/2008)


    Are you talking user databases or System databases?

    Because System Databases cannot be detached while SQL Server Service is running. You'll have to use the Alter Database command (see Books Online) to change their location, stop the service, and copy the databases over before restarting the service.

    Of course, TempDB, you just use the Alter Database command and don't worry about copying. It'll start up on the new partition just fine. (Or should).

    Just the user's database, the thing I went into SSMS Right click -> Properties -> Hightlight Database Setting. I changed the partition, D:/ for data and E:/for logs now when I try to create a database I get a error message.

  • Post the full text of the error message please.

    Brandie Tarvin, MCITP Database AdministratorLiveJournal Blog: http://brandietarvin.livejournal.com/[/url]On LinkedIn!, Google+, and Twitter.Freelance Writer: ShadowrunLatchkeys: Nevermore, Latchkeys: The Bootleg War, and Latchkeys: Roscoes in the Night are now available on Nook and Kindle.

  • There's an intermediary screen in SSMS between the time when you pick the .MDF to attach, asking you to confirm you want to attach. At the bottom of that screen it also shows you where it THINKS the files are (i.e. where they used to be before the detach). update those locations (yes you can change them) before clicking the Attach.

    Otherwise - what error are you getting?

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 7 posts - 1 through 6 (of 6 total)

You must be logged in to reply to this topic. Login to reply