Hi,
Read this: http://www.experts-exchang
Regards,
Faraz H.Khan
Main Topics
Browse All TopicsIf a data basebase contains mdb and log files and you split the files on two seperate arrays, I am confused how the mdb files get written to.
Example, I keep reading how you should put logs on a a raid 1 and mdb on a raid 10 or 5.
Are mdb files being read and written to similtaneously? Meaning that If i am entering data it takes longer but when i recall data it is faster?
Then log files just write and don't really read when i make a query?
Is there a good explanation somewhere online i can read up on this?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Hi,
Read this: http://www.experts-exchang
Regards,
Faraz H.Khan
Detach the database, copy the files, attach the database.
Ideally, mdf and ldf are not on the same physical drives.
See books online for more on detach attach....its really easy and can be done via the GUI
Use sp_detach_db to detach the database, then use sp_attach_db to reattach the database with the right files.
example:
Log file and db file for MYDB currently in C:MSSQL7data and want to move the log file to the C:MSSQL7LOGS directory. The files are called MYDB.MDF and MYDB.ldf.
sp_detach_db @dbname = 'MYDB'
sp_attach_db @dbname = 'MYDB',
@filename1 = 'c:mssql7dataMYDB.mdf',
@filename2 = 'c:mssql7LOGSMYDB.ldf'
I just tested it on a test db, and I had a problem pointing @filename2 to the logs directory, but I got around it by the following steps:
detach the db
rename or delete the log file
re-attach the db without specifying the log file (it creates a new one)
detach the db again
move the newly created logfile into the logs directory
attach the db, this time specifying the log directory and logfile name.
I tried just moving the logfile, but got an error, so used this method which worked.
Hope this helps.
(I assume the following: mdb file = data file)
Q: Are data files being read and written to similtaneously?
A: Yes. But you have to know that SQL Server performs lots of operations in memory first and then it uses its internal processes to write modified data pages from memory to disk.
Q: Meaning that If i am entering data it takes longer but when i recall data it is faster?
A: (from Books Online) SQL Server uses write-ahead log which guarantees that no data modifications are written to disk before the associated log record is written to disk. But there can be many reasons why writes are performed "slower" than reads (or vice versa).
Q: Then log files just write and don't really read when i make a query?
A: Transaction log is not used when you read the data. Only when you modify something.
Q: Is there a good explanation somewhere online i can read up on this?
A: I think Books Online (SQL Server documentation) is where you should start your reading. Here you can find some information on how transaction log works:
http://technet.microsoft.c
http://technet.microsoft.c
http://technet.microsoft.c
Business Accounts
Answer for Membership
by: vahiidPosted on 2009-11-03 at 22:35:52ID: 25736937
I think the main reason for that recommendation is the overhead distribution. In Microsoft Exchange (and I'm pretty sure in SQL), Before anything is written to the database file, it is first written to a transaction log. Once the transaction has been logged, the data is written to the database when convenient. Now if you have a lot of transactions and database updates, you will get a better performance if they are on separate arrays.
Normally server installs are done on two or more arrays. First one is used by OS - RAID 1 recommended - and the database array is recommended to be a raid 5, 10 or higher, so if you were to choose separate locations for your log and database, you'd go with RAID 1 for logs and RAID 5 for the database.
Also there is a disaster recovery factor in this as well, so that not all the data is lost if an array dies.