Online Training On SharePoint
                      

Saturday, 28 March 2009

Creating Site Collection in a Specific Content DB in SharePoint

I had a scenario where we had multiple content databases associated to a Web Application and we want to specify a particular Content DB in which SharePoint should create new Site collection. I tried to understand how SharePoint selects a content DB in which new site collection needs to be created when we create a new site collection from Central DB.

It depend on two factor:

1. Database Status: If the content database is in active state then only new site collection can be created into that. If the content database is in Offline mode SharePoint will not create any new site collection into this Content DB. Every Web application needs to have at least one Active Content DB. This was not helpful as I did not want to take the DB offline.

2. Difference between the maximum number of Site and Current number of sites:
If there are multiple content DB associated to Web Application which are in active state SharePoint decides the content DB based on the Difference between the maximum number of Site and Current number of sites. It creates the site in the Content DB where this difference is maximum.

We can control the maximum number of site collection which can be created in a content DB by changing the number in "Maximum number of sites that can be created in this Database" field.




now I added three content databases associated to a web application and all of them are in ready status. I have changed the maximum number of sites in each of them. Now when I create a new site collection it will go into the second content DB as this has 5 as the difference between Maximum number of site collection and current site collection. The other DB's has this difference as 3 and 4.:


Now after creating this site collection this difference is same for the second and third content db. Now in this case SharePoint checks the maximum number of site collection parameter in each associated content db .


The next site collection will be created in the Content DB where this number is highest.So the next site again will be created in the second content DB.



Now if we create one more site collection it will go into the third DB as this has the difference of 4 while the other two has the difference of 3.



So with this logic I was able to control this behavior and was able to specify the content DB in which SharePoint will be creating new site collections.

See also Creating Site Collection in a new Content DB

5 comments:

Anonymous said...

Note that marking a content database as offline does not stop people from using that content db. Users are still able to access all content and make updates. Marking a db offline prevents new site collections from being created in that db, and also prevents some housekeeping from being done to that database (like profile synchronization)

Anonymous said...

what if there are two content dbs with the same difference which is maximum ? where will the new site collection go?

Anonymous said...

what if there are two content dbs with the same difference , which is also maximum ? where will the new site collection go?

Unknown said...

what if there are two content dbs with the same difference , which is also maximum ? where will the new site collection go?

Unknown said...

what if there are two content dbs with the same difference , which is also maximum ? where will the new site collection go?

Related Posts with Thumbnails