SQL Server file locations.
-
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.
-
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.
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.
-
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.
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.
-
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.
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.
-
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.
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.