LDF and MDF locations

  • Hi All

    just a quick question

    should *.mdf's and *.ldf be keep on the same disk /same directory, or is there some other best practise thatr could be used?

    also,

    if this is the case (seperate draves/folders) how would one go about shifting current db's and preparing for future db's

    cheers

    todd


    Kindest Regards,

    Todd,non est vivere sed valere vita est

  • They should be on separate disks so that there is no contention for I/O.

    To move them, you can either

    - detact the database, move the files as desired and the reattach

    - backup the database and restore it. When restoring, you can specify location of each file with the "MOVE" option in the RESTORE command if you are using the restore command directly or by going to the options tab if you do it from enterprise manager

    You can set the default location for the MDF and LDF files by going to the server properties in enterprise manager. The "Database Settings" tab is the place to change the default location.

  • To piggy-back on happycat59, here is a Microsoft KB article that talks about how to move the files. I include it because it references the system databases and you have to treat them differently than user databases.

    How to move SQL Server databases to a new location by using Detach and Attach functions in SQL Server (224071)

    K. Brian Kelley
    @kbriankelley

  • Datafiles(.mdf) and logfiles(.ldf) should not be

    kept on a single disk,bcoz if the disk crashes

    you will not be able to recover the database upto the point of time..

    ..hema

  • I think detaching and attaching will be better and it is faster..

    ..hema

Viewing 5 posts - 1 through 4 (of 4 total)

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