Tuesday, July 27, 2010

Creating Site Collection in a separate Content Database

Since, most of us ignore the site collection basics and seldom plan our site collection content database storage needs. We are often unaware of SharePoint limitations in terms of content storage which affects our design at a later point in time.

Here is the simple yet very powerful stsadm command to create a site collection with a separate content database:

stsadm -o createsiteinnewdb -url http://webspinners/dept/hr -owneremail SharePoint@webspinners.com -ownerlogin Webspinners\SPAdmin -sitetemplate sts -title “Human Resources” -databaseserver "SERVER5" -databasename “HR Content Database”

In this example, a new site collection is created at the URL http://webspinners/dept/hr.
The Site Collection Owner is set to Webspinners\SPAdmin and the Site Collection owner email is set to SharePoint@webspinners.com.
The default team site template is used to create the site (the template is simply named ‘sts’, without the quotes.)
The database server is SERVER5 and the name of the database created is HR Content Database.
There are some reasons, why you could have a different content databases per site collections:

1. MS recommends to have content database not more the 100Gb for MOSS 2007 and 200GB for SP 2010.

2. It simplifies your backup and restore operation

3. It provides flexibility for Disaster Recovery (DR) strategy.

4. Modularity and Flexibility of data storage eliminates maintenance nightmares.

Possible Scenarios:
a. Media management for a site collection that stores heavy audio/video media files like .avi, .mpeg, .wav, .mp3

b. Knowledge Management requirement where you might think of implementing a separate KM site collection for managing thousands of word, excel, powerpoint, visio, pdf artifacts etc.

These scenarios need you to have a separate Content Database for your site collections, otherwise the overall application performance would degrade, searching these documents will be affected, backup and recovery will be a nightmare and moving these site collections into separate SP farms will be trouble some.

If you have already made the mistake of not having a separate content database store for your Site Collection, and want to move your Site Collection to a separate Content database in MOSS 2007, please follow these links :
http://msmvps.com/blogs/laflour/archive/2008/10/14/tips-to-create-a-site-collection-in-new-content-database.aspx
 and
http://blogs.msdn.com/b/mcsnoiwb/archive/2007/08/20/how-to-create-site-collection-in-a-specific-content-database.aspx

For moving site collection to a new Content DB in SharePoint 2010,  follow directions given by Microsoft : http://technet.microsoft.com/en-us/library/cc825328.aspx

8 comments:

  1. if we have to create a separate content database for an existed subsite. So how to get all the data of this subsite in a new content database. What are diffrent ways to do so?

    ReplyDelete
  2. Hi Pranita,

    You can add a new Content database per site collection and not per subsite. So ideally a web application can have multiple content databases, but one site collection can have only one instance of a content database assigned to it.

    I hope this clarifies your query.

    ReplyDelete
  3. Is there a way to have multiple content databases for one site collection?

    Here's the situation:
    I have a site collection with 7 subsites and 5 out of 7 will grow really big, so can I have 6 content database on the whole.

    Please let me know.

    ReplyDelete
  4. BTW.., we are using SharePoint 2010

    ReplyDelete
  5. Is it possible to have multiple content database for a single Site Collection. My requirement is I'm implementing Document Management System using SharePoint Foundation i have 1 site collection with 7 subsites(for Departments); as per Microsoft's recommendation content Database shoould not exceed 200GB, to overcome this issue is there any way to have multiple content Database for 1 site collection OR is there any way to have different content DB for subsites.

    Regards

    ReplyDelete
  6. As far as i know, Multiple content database is not possible for a single site collection.

    ReplyDelete
  7. There is a free solution available that automatically selects the smallest content database for new site collections: http://www.fiechter.eu/blog/Lists/Posts/Post.aspx?ID=21&mobile=0

    ReplyDelete
  8. Hi Mehul,
    This is Dharani from ITC, Hope you remeber?
    Please ping me.

    ReplyDelete