Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. SQL Server file locations.

SQL Server file locations.

Scheduled Pinned Locked Moved Database
databasesql-serversysadminquestion
5 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Septimus Hedgehog
    wrote on last edited by
    #1

    Chaps, I restored a database I was given. When I look at the database file properties, the MDF file is in the SQL Server folder C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER2008\MSSQL\DATA but the LDF file is in a different folder. All the other databases installed have both files in the same place. Is it possible to "detach" the log file, copy it to the same place as the MDF file and reattach it so both are referenced in the same place? I've really got no idea how this occurred. I accept I must have messed it up somehow but I've no idea what I might have been done. EDIT: It was my bad! I deleted the database and copied the two files to the same place. When I reattached the database, I must have clicked on the log file's eclipse (...) button. It was pointing to the wrong place but I was able to select the correct location. Sorry to have wasted time posting...

    If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.

    C 1 Reply Last reply
    0
    • S Septimus Hedgehog

      Chaps, I restored a database I was given. When I look at the database file properties, the MDF file is in the SQL Server folder C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER2008\MSSQL\DATA but the LDF file is in a different folder. All the other databases installed have both files in the same place. Is it possible to "detach" the log file, copy it to the same place as the MDF file and reattach it so both are referenced in the same place? I've really got no idea how this occurred. I accept I must have messed it up somehow but I've no idea what I might have been done. EDIT: It was my bad! I deleted the database and copied the two files to the same place. When I reattached the database, I must have clicked on the log file's eclipse (...) button. It was pointing to the wrong place but I was able to select the correct location. Sorry to have wasted time posting...

      If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.

      C Offline
      C Offline
      Corporal Agarn
      wrote on last edited by
      #2

      In general it is not recommended to have the data and log files in the same place. Best practices would have them on separate drives.

      S 1 Reply Last reply
      0
      • C Corporal Agarn

        In general it is not recommended to have the data and log files in the same place. Best practices would have them on separate drives.

        S Offline
        S Offline
        Septimus Hedgehog
        wrote on last edited by
        #3

        While I'm not a total noob to sql server, I can't lay claim to fully understanding issues related to system admin and best practices. Could you explain why it's desirable to split the locations? :) The reason I'm interested in knowing more is because by default, new databases seem to be created with the log and mdf files in the same location.

        If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.

        C 1 Reply Last reply
        0
        • S Septimus Hedgehog

          While I'm not a total noob to sql server, I can't lay claim to fully understanding issues related to system admin and best practices. Could you explain why it's desirable to split the locations? :) The reason I'm interested in knowing more is because by default, new databases seem to be created with the log and mdf files in the same location.

          If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.

          C Offline
          C Offline
          Corporal Agarn
          wrote on last edited by
          #4

          It has to do with disk access. For our setup we have different "disks" for data, log and tempdb. Unfortunately, I cannot find the link to explain this. I believe I found it while researching RAID setups.

          S 1 Reply Last reply
          0
          • C Corporal Agarn

            It has to do with disk access. For our setup we have different "disks" for data, log and tempdb. Unfortunately, I cannot find the link to explain this. I believe I found it while researching RAID setups.

            S Offline
            S Offline
            Septimus Hedgehog
            wrote on last edited by
            #5

            I can see the advantage splitting the database files onto different disks. I'll mention it to our support team and see if they can fill me in with more information. Thanks for the heads-up about it.

            If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups