Quantcast
Channel: SQL Server High Availability and Disaster Recovery forum
Viewing all articles
Browse latest Browse all 4689

I have split a partion but now it doesn't look good, I'm I missing something ?

$
0
0

Hi!

I have a SQL SERVER 2008 R2 with a datawarehouse db with 200 Gb with 2 partitioned tables with milions of records.

I have scripted this db and created a clean db in our lab env with the same structure but without records.

We want to try to split in our lab before going to production. The details are :

The partions are : P2006, P2007, P2008, P2009, P2010, P2011, P2012, P2013 , P2014

Each partion has 1 year except P2014 with year 2014 and year 2015 records.

The partion function is "as range left".

I need to move out (split)  the 2015 records from partion P2014 to a new partion P2015.

What I did is :

ALTER DATABASE MyDB
ADD FILEGROUP FG2015
GO

ALTER DATABASE MyDB
ADD FILE(
    NAME = 'MyLogicalFileName',
    FILENAME = 'C:\MyPhsyicalFile.ndf',
    SIZE = 1.5 GB,
    FILEGROWTH = 25%
)
TO FILEGROUP FG2015
GO

ALTER PARTITION SCHEME ps_DataAnual_dim_date_year
NEXT USED [P2015]
GO

ALTER PARTITION FUNCTION pf_DataAnual_dim_date_year()
SPLIT RANGE (16436)

(id 16346 correspond to 31-dec-2014)

The content of partion function is :

CREATE PARTITION FUNCTION [pf_DataAnual_dim_date_year](int) AS RANGE LEFT FOR VALUES (13514, 13879, 14245, 14610, 14975, 15340, 15706, 16071, 16436)
--GO

The content of partion scheme is :

CREATE PARTITION SCHEME [ps_DataAnual_dim_date_year] AS PARTITION [pf_DataAnual_dim_date_year] TO ([P2006], [P2007], [P2008], [P2009], [P2010], [P2011], [P2012], [P2013], [P2015], [P2014])

It does not look good. The order has been destroyed, please double check, I'm I missing something ?, Is it by design ?

Regards,

Miguel

Viewing all articles
Browse latest Browse all 4689

Trending Articles