Welcome to MSDN Blogs Sign in | Join | Help

Database Repartitioning with MergeContentdbs

Just wanted to do a quick post on database management.  Todd Klindt did a great post on moving site collections in a single bound that refers to a very nifty new stsadm command intended for SP1, but included in the October 9 public update called mergecontentdbs with details in KB934525.  This command allows you to easily and yes, I mean easily move site collections between databases.  Managing your sites between databases isn't something that's new with SP1 or even new with this version.  Splitting databases is something that Keith Richie was doing with SPSiteManager and IT was doing with WSSSplit.exe back in the WSS 2.0 and SPS 2003 days. 

Why would you ever want to split your databases?

If you do nothing to create more you will have one really large content database.  You'll also have one large site collection (since SCSignup is off by default in WSS and the Site Directory creates sites not Site Collections by default).  So in this worst case scenario where you end up with a 500GB single site collection you might end up finding the database a bit unwieldly from a management perspective.  Sure it's possible to have large databases and having a single site collection is the dream state right?  Maybe from a content perspective, but not from the day to day management perspective.  For 500GB of data you'd find it easier to manage 10 50GB databases, quicker to restore, quick to attach, quicker to detach, and with a multi threaded backup you may find it 5X faster to backup and restore or more.  You might also find that creating and deleting sites is slow or even causes SQL blocking in some cases.  If you're looking for a good database max size, start with 50 or 100GB.  Even with a 5TB SQL server you still only end up with 50 databases, so it really is a decent number to work with.  If you change your mind later you can consolidate your databases with mergecontentdbs.

So let's say you turned on the SSC (Self Service Creation) and enabled site collection creation could even be for a specific group, or you created a managed path and enabled it for your site directory creation.  Now you end up with lots of site collections.  Again by default these all go into a single content database per web application.  Sure you should use quota templates thus giving site collections a default quota as they are provisioned.  By default you'll end up with 15000 site collections all in one database before it stops you.  By no means do I recommend 15000 site collections per databases.  Even if your site collections are small I'd recommend somewhere around 200-500 site collections and 50-100 for medium and some databases are great with 1 site collection for those that are going to grow beyond 10GB.  Might as well start off putting them in their own database when you know they are going to grow big.  STSADM has a command for you here as well ("stsadm -help createsiteinnewdb" for the syntax).  You can create site collections in a new content db.

So you're in a situation where you have 500 small sites and one massive site but you find STSADM backup and restore failing to complete or when you do back it up and restore it, it's corrupt.  Yep this does happen.  Especially with the big ones.  My suggestion is even though it may sound counter intuitive, you should move all the small ones into different databases and leave the large one.  You'll find it more reliable and it also gives you a chance to split the rest of the site collections as you go.

What you can't do is split sites between databases with STSADM.  Two content databases can't share the same site collection.  Sites can be promoted.  You can use STSADM -o export (be sure to include security) to backup the site and then import it to a new site collection.   That new site collection could be in a new database.

I did a instructor led lab at IT Forum where in the class we worked through figuring out how to target new site collections to a specific database without closing off all the other databases.  How?  Set one database to a super large number say 30,000.  All new site collections will be created in that database with the most "capacity" for site collections.  Don't believe me?  Try it.  Prove me wrong.

With all this thought on managability, guess what else Todd did?  He posted steps on upgrading from SQL Express to SQL Server Standard or Enterprise.  He's my hero for the week.  Not only because of these posts, but because of his great STSADM and SQL talk in Barcelona.  He also lent me some money when I lost my wallet.  Good guy!  Hats off to you Todd.

Terms: 

Web Application - IIS Virtual Server, IIS Web Site,  Application

Site Collections - Top level sites, Site as seen in central admin UI and often in STSADM, SPSite in OM, parent sites

Sites - Webs, site, sub site, sub web, SPWeb in OM, child sites

Workspace - 1) Type of site collection or site. 2) Template such as document workspace or meeting workspace

SITE DB = Content Database (site database is a SPS 2003 term for the content database)

Published Tuesday, November 27, 2007 6:03 PM by joelo

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# Free People Searches » Database Repartitioning with MergeContentdbs

Wednesday, November 28, 2007 8:42 AM by Chris Quick

# re: Database Repartitioning with MergeContentdbs

Joel,

Great post and insight into DB management. However, I do have a question. I may be reading between the lines, but in the post it appears you can create managed paths and dictate which paths users can use to create site collections with SSC. Is this possible, or did I misunderstand?

Basically, I want to know if it is possible how I might set up the capability for some users to create site collections in <root>/extranet/sites and others to be able to create them in <root>/intranet/sites. If this is possible, I'd be very interested in learning how!

Thanks!

Chris Quick

Wednesday, November 28, 2007 5:06 PM by Steve Caravajal's Ramblings

# Managing Site Collections: new STSADM command

Have you ever wanted to move a site collection from one content database to different content database?

Thursday, November 29, 2007 8:56 PM by joelo

# re: Database Repartitioning with MergeContentdbs

You're too kind.  :)

tk

Friday, November 30, 2007 2:11 AM by Microsoft SharePoint Products and Technologies Team Blog

# Preview into WSS 3.0 SP1 and SharePoint Server 2007 SP1

Anticipation and excitement around Service Pack 1 for WSS 3.0 and Office SharePoint Server 2007 has been

Friday, November 30, 2007 3:03 AM by Noticias externas

# Preview into WSS 3.0 SP1 and SharePoint Server 2007 SP1

Anticipation and excitement around Service Pack 1 for WSS 3.0 and Office SharePoint Server 2007 has been

Friday, November 30, 2007 3:18 AM by joelo

# re: Database Repartitioning with MergeContentdbs

When you have multiple managed paths it creates a little drop down in the SSC allowing users to choose.  If you create specific inclusions you can use the central admin site creation to create sites collections in the explicit inclusions.

Example with managed paths and the central admin site creation at a path like http://domain.com/sitecollection where normally you'd have http://domain.com/sites/sitecollection

Saturday, December 01, 2007 2:47 PM by On the MOSS Road

# Preview into WSS 3.0 SP1 and SharePoint Server 2007 SP1

Anticipation and excitement around Service Pack 1 for WSS 3.0 and Office SharePoint Server 2007...

Tuesday, December 04, 2007 5:12 AM by stefan demetz

# re: Database Repartitioning with MergeContentdbs

Great post, thanks

Difficult question:

Can a Sharepoint content DB be partitioned at the SQL Server 2005 level ?

Tuesday, December 04, 2007 8:12 AM by joelo

# re: Database Repartitioning with MergeContentdbs

Stefan,

No, it isn't recommended to create file groups.  Although SharePoint really doesn't know much about the SQL storage.  Database partitioning in file groups are one of those things that were simply untested.  I've heard you won't really notice until you get into backup/restore scenarios.  The other thought is, it really doesn't partition well since the file streams/blobs are really in one table and doesn't partition well.

Tuesday, December 04, 2007 1:59 PM by Ralph in Chicago

# re: Database Repartitioning with MergeContentdbs

The big question I have with -o export is what happens to meta data such as "created by" "last modified date" "owner" etc.   is anything lost?  

Wednesday, December 05, 2007 9:39 AM by joelo

# re: Database Repartitioning with MergeContentdbs

-o Export does not impact created by or owner.

Tuesday, December 11, 2007 2:30 PM by Luis Du Solier G. - SharePoint en Español

# Microsoft ha liberado el Service Pack 1 para Windows SharePoint Services (WSS) 3.0 y Microsoft Office SharePoint Server (MOSS) 2007

El primer Service Pack (SP1) tanto para WSS 3.0 y MOSS 2007 ya están disponibles para su descarga desde

Tuesday, December 11, 2007 2:30 PM by SharePoint en Español - Luis Du Solier G.

# Microsoft ha liberado el Service Pack 1 para Windows SharePoint Services (WSS) 3.0 y Microsoft Office SharePoint Server (MOSS) 2007

El primer Service Pack (SP1) tanto para WSS 3.0 y MOSS 2007 ya están disponibles para su descarga desde

Thursday, December 13, 2007 10:14 AM by Sabeeh

# re: Database Repartitioning with MergeContentdbs

How do I get a hold of Todd?

Tuesday, December 18, 2007 4:23 AM by Joel Oleson's Blog SharePoint Land

# 12 Things to do over the Holidays

If you're in the office and finding there's all of a sudden a chance to read up and catch up on tools,

Tuesday, December 18, 2007 4:34 AM by Noticias externas

# 12 Things to do over the Holidays

If you&#39;re in the office and finding there&#39;s all of a sudden a chance to read up and catch up

Tuesday, January 08, 2008 12:06 PM by erugalatha

# re: Database Repartitioning with MergeContentdbs

Hi,

I have a legal requirement to keep content for site collections in the seperate databases.  e.g. http://intranet/mydeptone is a site collection in content_db_mydeptone.  If I create it will all sites created as sub-webs of mydeptone be in the content_db_mydeptone database?  

At the moment from my experiements even though mydeptone site is in content_db_mydeptone it creates all subsequent sites in WSS_Content database which has the highest delta between max sites and the warning level.

How do I target sites to content databases without worrying about deltas in the content databases?

# How do your MOSS/WSS content databases fill up?

Have you ever wondered how you should plan on setting up your content database for your MOSS/WSS farm

Leave a Comment

(required) 
required 
(required) 
 
Page view tracker