Partitioning Table Error with more partitions than Filegroups
Asked Answered
P

7

5

I am trying to partition a DB table, I have created the filegroups correctly (I think), I had to add a couple of extra filegroups along the way as I had an error with the amount of partitions compared to filegroups (I have trouble getting my head round this), I have created a partition function without problem, but when I try to create the partition scheme I get the following error:

Msg 7707, Level 16, State 1, Line 2 The associated partition function 'PARTFN_INV_LINE_FACT' generates more partitions than there are file groups mentioned in the scheme 'PARTSCH_INV_LINE_FACT'.

Have I missed a step?

I am new and doing this to learn for a future task, so please excuse me if I haven’t given enough information. I have included everything I have done below.

All filegroups have to be explicitly entered in the scheme.

Papillary answered 17/6, 2011 at 10:40 Comment(0)
P
1

All filegroups have to be explicitly entered in the scheme.

Papillary answered 20/6, 2011 at 8:20 Comment(0)
O
8

Without seeing the code, I can't be 100% sure, but I suspect you've run into the exact problem I did when I tried to reuse a current partition function with a new partition scheme. My partition function defined 16 range values, however my partition scheme only defined 8 partitions, resulting in the same error you've cited.

In my case, the solution was to simply not try to reuse the existing partition function, and instead create a new partition function and partition scheme, with an equal number of range values and partitions like this:

CREATE PARTITION FUNCTION partitionFunctionName(datetime) AS RANGE LEFT FOR VALUES ( '20130228 23:59:59.997',
'20130331 23:59:59.997',
'20130430 23:59:59.997',
'20130531 23:59:59.997',
'20130630 23:59:59.997',
'20130731 23:59:59.997',
'20130831 23:59:59.997',
'20130930 23:59:59.997'
) GO

CREATE PARTITION SCHEME [partitionSchemeName] AS PARTITION partitionFunctionName TO ( [PartitioningFileGroupName1] ,[PartitioningFileGroupName2] ,[PartitioningFileGroupName3] ,[PartitioningFileGroupName4] ,[PartitioningFileGroupName5] ,[PartitioningFileGroupName6] ,[PartitioningFileGroupName7] ,[PartitioningFileGroupName8] ,[PRIMARY] )

GO

I know this is an old question, but maybe this will help someone avoid the same issue!

Oliverolivera answered 10/4, 2013 at 20:20 Comment(0)
B
7

Probably you forgot to include the [PRIMARY] filegroup in your partition scheme.

Boulder answered 12/3, 2014 at 21:39 Comment(0)
P
1

All filegroups have to be explicitly entered in the scheme.

Papillary answered 20/6, 2011 at 8:20 Comment(0)
S
1

The number of criteria must be missing a number of filegroups, partition functions.

Spellbinder answered 21/6, 2012 at 7:14 Comment(0)
S
1

you have to match the filegroups.

SELECT name AS AvailableFilegroups FROM sys.filegroups WHERE type = 'FG'

The result of the query should be equal to the scheme.

Spindrift answered 8/5, 2020 at 8:12 Comment(0)
S
1

Have you mentioned the filegroups which are available in your system?

You may get filegroup list from the query:

SELECT name AS AvailableFilegroups
  FROM sys.filegroups
  WHERE type = 'FG' 
Spindrift answered 8/5, 2020 at 8:29 Comment(0)
S
1

Also I faced the same error: The number of filegroups or range values is not valid. Enter an extra filegroup in addition to the number of boundary values. I just added a filegroup for the last empty row.

enter image description here

Synder answered 10/11, 2022 at 19:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.