Solved

SQL Server - data files - How is write operation performed  on data files

Posted on 2009-07-01
6
385 Views
Last Modified: 2012-05-07
Hi,

   I would need some clarifications on how the write operations are performed on SQL Server data files.
   
   Say that we have only one file group (PRIMARY) with 10 data files inside. What I would need to know (I would needk if possiblek a valid Microsoft link next to the explanation) is, in case SQL Server needs to write 100 MB of data inside these data files how is the write operation done? (also considering that the 10 data files are not equal in size and that the free space inside each of the data files is also not equal in size).


Thanks in advance
0
Comment
Question by:rares_dumitrescu
  • 3
  • 3
6 Comments
 
LVL 2

Expert Comment

by:Sguzek
ID: 24753950
Hi,

The topic is quite big. Better start from reading "Physical Database Storage Design" http://technet.microsoft.com/en-gb/library/cc966414.aspx, you will find further references there.

Regardsm
Slawek
0
 

Author Comment

by:rares_dumitrescu
ID: 24754159
Hi,

    I read this one but it does not say how exactly data is written when you have more data files in the same file group.

    I have a very good understanding about the overall SQL Server storage picture but I need a more to the point explanation.

     As I know SQL Server should stripe the extents across the data files and theoretically what happens is that write operations are load balanced between the data files. Now I need to know the formula or the thinking behind this load balancing operation- how much weight a data file size and the free space inside inside has when SQL Server decides how much to write to one data file and how much to write to the other.

Thanks
0
 
LVL 2

Expert Comment

by:Sguzek
ID: 24755126
Hi,

No, extents are not stripped across data files. I mean single extent is never stripped across data files.

Load balancing works only when new extents are allocated. If SQL storage engine has to allocate one new extent  then it is allocated from the file with most free storage space. When it needs to allocate more than one extent then the first new extent goes to the data file with most free space, and second can go to the same file if after allocating first extent still the most space is in the same file.

As long as the free space will not be balanced between files all new extents will be allocated from the file with the biggest free storage space - so it is crucial to create database with data files equal in size.

FILEGROUP has nothing to do with physical data allocation as far as I now - it is used only for logical management, like backups etc.

Regards,
Slawek





0
Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

 

Author Comment

by:rares_dumitrescu
ID: 24799005
Hi Slawek,

     This is exactly what I also suspect judging by the SQL2k5 I/O DMVs, do you also have some web-links for this info?

Thanks
0
 
LVL 2

Accepted Solution

by:
Sguzek earned 500 total points
ID: 24813548
Hi,

I'm not aware of any web source where this was stated explicitely, I'm afraid.

Regards,
Slawek
0
 

Author Comment

by:rares_dumitrescu
ID: 24817534
thanks
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
Concerto Cloud Services, a provider of fully managed private, public and hybrid cloud solutions, announced today it was named to the 20 Coolest Cloud Infrastructure Vendors Of The 2017 Cloud  (http://www.concertocloud.com/about/in-the-news/2017/02/0…
This tutorial will walk an individual through the process of installing the necessary services and then configuring a Windows Server 2012 system as an iSCSI target. To install the necessary roles, go to Server Manager, and select Add Roles and Featu…
This Micro Tutorial will teach you how to reformat your flash drive. Sometimes your flash drive may have issues carrying files so this will completely restore it to manufacturing settings. Make sure to backup all files before reformatting. This w…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question