开发者

How to change the partition scheme in MS SQL server?

I've currently created a partition scheme / function in my database, and applied it to a number of tables. It has worked perfectly, and I've reached the results I needed.

The issue is, if I want to extend the partition function, I have to change the partition scheme as well, every single time..

Currently, the partition scheme is defined as follows:

CREATE PARTITION SCHEME [Stores]
    AS PARTITION [StoreSplitter]
    TO ([PRIMARY], [PRIMARY], [PRIMARY], [PRIMARY], [... etc ...], [PRIMARY])
GO

After readi开发者_Python百科ng MSDN, I realised I should have created it like this:

CREATE PARTITION SCHEME [Stores]
    AS PARTITION [StoreSplitter]
    ALL TO ([PRIMARY])
GO

In this case, all partitions would use the same store, and I don't have to change it every time, to support another partition.

Is there any way to alter the existing partition to use ALL TO ([PRIMARY]) without recreating the whole thing, or is that just wishful thinking? :(


I don't believe there is. If there was a way to change this behaviour, I'd expect it would be an additional option in ALTER PARTITION SCHEME, so that you could specify that the NEXT USED that you've just supplied should gain the same status as specifying ALL in CREATE PARTITION SCHEME:

If ALL is specified, the sole file_group_name maintains its NEXT USED property for this partition_function_name

But I'm not seeing such an option.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜