Quantcast
Channel: Forum SQL Server Database Engine
Viewing all articles
Browse latest Browse all 15889

Need to Create Monthly Partition (for 1 years Data) on Existing Table. Need to know the method to make it Dynamic?

$
0
0

Hi All,

We have few tables with very huge data & giving performance related issue during load, Extract. So decided to go for Table Partition in 2005. I have gone through many forum & got idea about Table Partitioning steps. 

Still One point is not clear for me that how can I automate it? 

For Example:

In our Warehouse we are maintaining only one year of data. So planning to create 13 monthly partitions on Transaction Date column. 

Partition 1 holds data which are less than 1-March-2012

Partition 2 holds data which are Greater Than & Equal 1-March-2012 And Less than 1-April-2012

Partition 3 holds data which are Greater Than & Equal 1-April-2012 And Less than 1-May-2012

........................................................................

Partition 12 holds data which are Greater Than & Equal 1-Feb-2013 And Less than 1-March-2013

Partition 13 holds data which are Greater Than & Equal 1-March-2013 And Less than 1-April-2013

Now What I want to achieve, On 31st March Midnight (11:59:59 PM), Data has to move to one partition to another partition & Partition 13 has to be available to hold the data for range Greater Than & Equal 1-April-2013 And Less than 1-May-2013

So after 31st March Midnight (11:59:59 PM), above partitions have to have data for below ranges:

Partition 1 holds data which are less than 1-April-2012

Partition 2 holds data which are Greater Than & Equal 1-April-2012 And Less than 1-May-2012

Partition 3 holds data which are Greater Than & Equal 1-May-2012 And Less than 1-June-2012

........................................................................

Partition 12 holds data which are Greater Than & Equal 1-March-2013 And Less than 1-April-2013

Partition 13 holds data which are Greater Than & Equal 1-April-2013 And Less than 1-May-2013

Please suggest me the steps to achieve the above? Please provide detail description or links available.

Thanks in advance!!! 

I have gone through many forum & found the Switching option:

So With switching option, Is it possible to Empty the 2nd last Partition (In Above case Partition 2) & move these data to Partition 1 & then make available Partition 2 for the latest month (i.e April 2013 Month in above case)?

Please advice.

 


Thanks Shiven:) If Answer is Helpful, Please Vote


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>