I explain a little about what partitioned tables are in SQL Server and then I give a recap of various methods for managing partitioned tables. What are Partitioned Tables? (2005) SQL Server partitioned tables were introduced with SQL Server 2005 Enterprise Edition. Partitions are used to improve maintenance and management of large tables. I’m not going to explain the what and the why of partitions. That would be like reinventing the wheel. Partitions are best explained with Kimberly Tripp’s white paper Partitioned Tables and Indexes in SQL Server 2005. Whether you’re new to partitioning, or whether you’re the MS employee who designed partitioning, I highly recommend reading the article it’s got something for everybody. What’s new with 2008? See above. There hasn’t been much that’s changed in terms of basic concepts. However, there are a couple features that have been introduced: Great, so now you know all there is about partitioning, sliding window scenarios, partition switching, aligned vs. unaligned indexes. So now what’s the best way to go about managing these partitions? There are a few options that I’ve come across that each have their benefits and drawbacks. I’d like to list them out here. T-SQL (of course): Using straight T-SQL scripts does everything you need without the handholding. SQL Partition Manager (from DonWellSoft). According to their website, SQL Partition Manager “automates partition management tasks”. It does a very good job of enabling the DBA to perform all tasks that deal with SQL Server partitioning. The price tag starts at $199 which is a small fraction of the price of SQL Server Enterprise Edition. The biggest advantage that this software has over the other options is its user interface. You can browse partitioned tables faster and easier. It’s nice and well worth trying the limited time demo version. SQL Server Partition Management A codeplex project by Stuart Ozer from Microsoft. This program is a command line tool that allows people to manage sliding window scenarios. It can also create staging tables to be able to switch data in or out. In fact that is the only focus of this program; to prepare staging tables and to switch partitions with such partitions. It is an excellent alternative to maintaining T-SQL scripts to be used during weekly or monthly partition maintenance tasks. But – as with T-SQL scripts – there is no hand-holding here. Also, there is no output-as-script feature available either. SSMS wizards: As mentioned earlier, these wizards helps create, manage and modify partitions. They are very script-able and easy to use. In short these wizards accomplish what the command line tool SQL Server Partition Management does except through a UI. Toad for SQL Server (Up and Coming version 4.5) I also understand that Toad for SQL Server version 4.5 will have partitioning features and partition management in Capacity Manager as well. (Thanks Brent!) Summary
There is one thing that I wish for it. That it has a “view script” feature that you can use before implementing a change. I mean, it’s always possible to capture everything using a server side trace with SQL Profiler, but that reminds me of the old Saturday Night Live joke: “For a transcript of today’s episode, write down everything I’m saying”
April 6, 2009
Methods of Managing SQL Server Partitions
2 Comments »
RSS feed for comments on this post. TrackBack URL

Hi Michael,
There’s also a couple of other partitioning features in 2008 that I’m really excited about. For example, they’ve improved parallelism for querying partitioned tables. They’ve also given us the ability to swap out partitions on replicated tables, which was missing in 2005.
Nice article!
Regards,
Michelle
Comment by Michelle Ufford — April 8, 2009 @ 6:53 am
Thanks Michelle,
I missed those features. It makes sense that partitioned tables should play nicely with replicated tables. Both features are ones which that help DBAs make their systems highly scalable.
Michael
Comment by Michael J. Swart — April 8, 2009 @ 7:25 am