Moving data and log files after database creation

  • For SQL Server 2000 and after the creation of a database, can we move the data and log files from C: drive to D: drive?  If yes, what is a proper way to do it?

  • You can either do a full backup and then a restore using  "with move" specifying the new locations.

    Or you can detach the database and move the files.  You might want to rename the files on the C drive after detaching.  Re-attach the database using the new file locations.  If you use Enterprise Manager, you will have to specify the location of both files, it won't see the log file by itself.  Once everything looks good, delete the files on C.

     

     

    Aunt Kathi Data Platform MVP
    Author of Expert T-SQL Window Functions
    Simple-Talk Editor

  • Forgot to mention, this advice is for user databases, not system databases.

    Aunt Kathi Data Platform MVP
    Author of Expert T-SQL Window Functions
    Simple-Talk Editor

Viewing 3 posts - 1 through 2 (of 2 total)

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