1

I'm quite familiar with SQL-Server as a developer but not so much in the DBA role.

Currently I'm working on a rather large DB (~7TB, living in 7 files, all equal in size and all within one single file group). The DB is running out of disc space.

The customer is going to increase the space available by 2 TB.

To state some things first:

  • The system is a fail over cluster
  • It is - why ever - no option to add a second file group.
  • I know that using a second file group might offer great benefits... (not wanted by the customer. It's an old system and nobody dares to touch it more than necessary...)

The options I'm thinking of:

  • I could use ALTER DATABASE with MODIFY FILE to increase the size of the existing files (~1TB each at the moment).

  • I could use ADD FILE to add one or two additional files similiar to the existing ones.

The questions

  • Is there anything special to keep in mind with fail over clusters'?

  • Is there any reason why to prefere one of the options?

remark: The goal is as little impact as possible.

1 Answer 1

1

Is there anything special to keep in mind with fail over clusters?

No

Is there any reason why to prefere one of the options?

Yes, especially depending on your IO subsystem. SQL Server uses two algorithms when deciding which file to use for allocating new extent. Round robin and proportional fill. My recommendation will be to use your first option.

I could use ALTER DATABASE with MODIFY FILE to increase the size of the existing files (~1TB each at the moment).

Round robin means that the SE will try to allocate from each file in a filegroup in succession. For instance, for a database with two files in the primary filegroup (with file IDs 1 and 3, as 2 is always the log file), the SE will try to allocate from file 1 then file 3 then file 1 then file 3, and so on.

The twist in this mechanism is that the SE also has to consider how much free space is in each of the files in the filegroup, and allocate more extents from the file(s) with more free space. In other words, the SE will allocate proportionally more frequently from files in a filegroup with more free space. This twist is called proportional fill.

Proportional fill works by assigning a number to each file in the filegroup, called a ‘skip target’. You can think of this as an inverse weighting, where the higher the value is above 1, the more times that file will be skipped when going round the round robin loop. During the round robin, the skip target for a file is examined, and if it’s equal to 1, an allocation takes place. If the skip target is higher than 1, it’s decremented by 1 (to a minimum value of 1), no allocation takes place, and consideration moves to the next file in the filegroup.

Paul Randal explains this in details with example, Investigating the proportional fill algorithm.

3
  • Thank you very much for this comprehensive answer. About "fail over cluster": Is it correct to assume, that changing the file's maxsize in the leading side will be synced to the fail-over side automatically?
    – Shnugo
    Feb 24, 2020 at 7:42
  • Are you talking about 'Always On Availability Group'? The answer is yes, as it is a database property. Feb 24, 2020 at 12:50
  • Your help is highly appreciated!
    – Shnugo
    Feb 24, 2020 at 16:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.