Skip Links

Network World

Creating a Site Collection in a New Content Database

One widely held misconception about SharePoint 2007 is that a Web Application can only span a single Content Database.  The truth is that a Web Application can span multiple Content Databases, the limitation is at the Site Collection level.  Why this is an important concept is because of the fact that a single Content Database for a SharePoint Solution is not ideal, as the size can get very large quickly, and there is no easy way to move content out of a Content Database.

The solution to this issue is to create multiple Site Collections within a Web Application and to add those Site Collections to their own Content Database.  A scenario for this would be as follows: Let’s say that CompanyABC wants to setup an enterprise document management platform using SharePoint 2007.  They configure the namespace docs.companyabc.com as a Web Application on SharePoint, then they configure a root site of http://docs.companyabc.com with a single Site Collection and single Content Database.

Since CompanyABC realizes that the amount of content in the system will grow large very quickly, when the create the platform they configure the documents to be stored across multiple site collections by department.  They create a Managed Path in SharePoint of /dept/ and then create site collections under the Managed Path, configuring those Site Collections to have their own Content Databases.  So, http://docs.companyabc.com/dept/it has its own content database, http://docs.companyabc.com/dept/hr has its own, http://docs.companyabc.com/dept/marketing does as well, and so on.

The reason for all of the confusion about being able to do this stems from the fact that the Site Collection creating GUI in the SharePoint Central Admin tool does not prompt the administrator for which Content Database to add the Site Collection to.  To make matters worse, SharePoint simply chooses which content database to add to by doing a ‘smart’ analysis of current database usage, which doesn’t allow for any control over where the Site Collection goes.

There are two methods of getting around this.  In the first method, the administrator goes to all Content Databases (SharePoint Central Admin – Application Management Tab – Content Databases) and takes the databases ‘offline’.  Note that simply taking the databases offline does not affect user functionality; it only dissallows new Sites from being created in the specific Content Database.  Once all Content Databases except for the one desired are taken offline, creating a new Site Collection will force that Site Collection to be created in the one you want.

If the databases aren’t created in advance, there is an even easier way to do this, by using the –createsiteinnewdb flag with the STSADM tool.  The STSADM tool (located on web front-ends in the \program files\common files\microsoft shared\web server extensions\12\bin folder) is a fantastic administrative tool that performs a myriad of administration with SharePoint.  In this case, it allows you to create a new Site Collection within a new Content Database.  The following Syntax illustrates one example:

stsadm -o createsiteinnewdb -url http://docs.companyabc.com/dept/hr -owneremail -ownerlogin COMPANYABC\SPAdmin -sitetemplate sts -title “Human Resources” -databaseserver SERVER1 -databasename HR-Content-DB

In this example, a new site collection is created at the URL http://docs.companyabc.com/dept/hr.  The Site Collection Owner is set to COMPANYABC\Spadmin and the Site Collection owner email is set to .  The default team site template is used to create the site (the template is simply named ‘sts’, without the quotes.)  The database server is SERVER1 and the name of the database created is HR-Content-DB.

Using this concept, you can construct a SharePoint environment that will scale quite nicely, as content is distributed across multiple databases.  In addition, If you need to scale to multiple database servers, it simply involves moving content databases to the new server and updating the location in SharePoint.

Cheers,

Michael

Searching

0

How does that work with respect to search... when you create a new site collection it seems to create it's own world... the main tab navigation seems to disappear and the only tab is home. I can't have every section of my site living in it's own world. Same goes for search. I need a global search to search across all site collections? How do I seperate the content databases without seperating the search or navigation?

Thanks,
Greg

Site Collections

0

Hi Greg,

Yes, Site Collections act as something like their own islands in respect to built-in navigation.  Global Search across Site Collections can be performed from within the MOSS 2007 Search Center, however, so this can help consolidate search queries if you are using MOSS.  Navigation is a bit trickier, you essentially have to build your own navigation structure across multiple site collections, either through custom links on the built-in navigation bar or through the creation of a new navigational component.

In a nutshell, the creation of multiple site collections are useful for larger environments where the amount of data is too large for a single content database.

Cheers,

Michael

Thanks

0

Thank you for your response. That is what I was thinking we would have to do. Now I have heard from the Blogs that 50 GB is the max size you should let your content databases get to. But I also hear that 15 GB is about as big as you can get without seriously impacting performance? What is your experience?

Regards,
Greg

100GB for Content Databases

0

A good recommended Microsoft best practice is to not let your content databases get larger than 100GB, for recoverability reasons.  That said, I've seen larger databases running without issue.  It's less of a performance thing than a backup/restore issue, however.

Cheers,

Michael

Db Size and multiple Content DB's..

0

As far as he 50GB issue, I can assure you that is not the case or a limitation. We are running SQL Server 2005 (latest SP) with SP and have a content DB of 80 GIG right now.

We are in the process of starting to plan a spanning out of that content DB to multiple DB's but onlt because of personal fears , nothing related to performance or any DB Issues.

Multiple site collections sharing content DB's

0

Thanks for the info Michael.

Quick question. Is it possible to specify site collections into a content DB? For example, I would like to contain departments into a single content DB, versus "I.T." in it's own.

It doesn't appear that I can do a restore or import and specify an existing content database.. or can I?

Multiple site collections sharing content DB's

0

Hi Ian,

Yes, but you have to bring the other content databases to 'offline' status...this forces the restore of the site collection to be created in the only database that's not specified as 'offline'.

Cheers,

Michael

Sub Sites

0

Thank you for the information about creating a new site collection in a new database. It has been VERY helpful!

I have two questions though:

Will SharePoint automatically put any subsites of the new site collection in the same database or is there a chance Sharepoint will just put the new subsite content in the "best fit" database?

Secondly, is there a way to migrate existing content from one database to a new database?

Thanks for the help!
Amy

Sub Sites

0

Hi Amy,

 Once a site collection has been provisioned into its own Content Database, all new sub-sites will automatically be created within that particular Content Database.  So, no worry about the sub-sites being put into the wrong content database.

As far as migration is concerned, the only native way to migrate content is to use stsadm -o backup -url, etc. to backup a site collection to a flat file, then restore it to a different content database.  There are some third-party tools available as well.

 Cheers,

Michael

Content migration ( Deployment )

0

Hi Amy / Michael,

If the two site collections are in different content database, you can use the Central Administration > Operations > Content Deployment section to deploy content from one site collection to another.

Note: the only pre-requisite is that both the sites has to be in a different content database.. because the GUID's used for various ID's has to be unique within any content DB.

Cheers,
mano

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Welcome, visitor. Register Log in