Вопрос

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.

Это было полезно?

Решение

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.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с dba.stackexchange
scroll top