Search icon CANCEL
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Save more on your purchases!
Savings automatically calculated. No voucher code required
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Microsoft SharePoint 2010 Administration Cookbook

You're reading from  Microsoft SharePoint 2010 Administration Cookbook

Product type Book
Published in Jan 2011
Publisher Packt
ISBN-13 9781849681087
Pages 288 pages
Edition 1st Edition
Languages
Author (1):
Peter Serzo Peter Serzo
Profile icon Peter Serzo

Table of Contents (17) Chapters

Microsoft SharePoint 2010 Administration Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
1. Preface
1. Upgrading and Configuring SharePoint 2010 2. Service Applications 3. Farm Governance 4. Site Administration 5. Monitoring and Reporting 6. Search 7. Security Administration: Users and Groups 8. Content Management 9. Social Architecture 10. Backup and Restore 11. Performance Monitoring

Creating and associating content databases to a specific web application and site collection


A web application is not limited to using a single content database. SharePoint allows you to associate many content databases to a web application. One of the reasons to do this could be based on the size of the content database. If the content database is larger than 200 gigabytes, it makes more sense to distribute this content across two content databases.

A different consideration is factoring the type of data that is being housed in the content database. If there is a marketing site that contains media files such as photos and video, it may be desirable to create a content database just for this site collection data. Another example is housing all legal data into one content database/site collection for a litigation department.

Finally, a major benefit of doing this is disaster recovery. Knowing where your data is, and how it is structured, will allow you to implement a disaster recovery strategy that is efficient, effective, and flexible.

The data that is created is not the same, that is, we have various kinds of data. Data has different properties and may even have different backup and restore service level agreements. However, multiple content databases may be connected to one web application.

This recipe will show how to create multiple content databases to one web application and apply the appropriate site collection to the corresponding content database.

Getting ready

Ensure that you are a member of the Farm Administrators SharePoint group on the computer accessing the Central Administration site. You must have the correct permissions to create a database (typically dbcreator and sysadmin).

How to do it...

  1. 1. Open the Central Administration screen. Under Application Management in the Databases section, click Manage Content Databases.

  2. 2. At the top of the resultant page is the Add a content database option. Click the option and the following screenshot will be displayed:

  3. 3. The database name is given a GUID suffix by default. Change the database name to be relevant but use a naming convention. In the case of the preceding screen, I will change database name to WSS_Content_Marketing. Keep the rest of the defaults and click OK.

    The content database will be created and listed under Manage Content Databases.

  4. 4. To ensure that the site collection gets added to the proper content database, ensure that you are still under Manage Content Databases.

  5. 5. Click on the content database(s) you don't want the site collection to get added to.

  6. 6. Under the Database Information settings, set the Database status to Offline. Click OK. Refer to the next screenshot:

  7. 7. Navigate to Application Management, then Site Collections. Under this section, click Create site collections.

  8. 8. Fill the information for Title, URL, select a template, and include a primary site collection administrator. Click OK.

  9. 9. The site collection should be created and added to the appropriate content database. To check this, navigate back to the Manage Content Databases screen. See the example shown in the following screenshot. WSS_content_7777 is Stopped (offline) and the new site has been added to WSS_Content_Marketing.

  10. 10. Reverse the action from step 6 and put the content database back in Ready state.

How it works...

The first half of the procedure is self explanatory. We are creating a content database under the appropriate web application. The second half of the procedure takes the database offline. This action will ensure that the next site collection cannot be added to that database.

The action of assigning a site collection to a content database is very similar to network load balancing. The site collections are assigned quite evenly across the content databases while they are online.

There's more...

When doing a SharePoint 2010 upgrade of multiple content databases, ensure that the first content database that you add contains the root site for the associated web application. The rest of the content databases for the web application can be added in any order afterwards.

More info

There will be times when you do not want to add any more site collections to a content database. In order to accomplish this, perform the following steps:

  1. 1. In Central Administration, under the Databases section, click on the Manage Content Databases option.

  2. 2. Click on the database that you wish to no longer add site collections to.

  3. 3. Change the Maximum number of site collections settings (under Database Capacity Settings) to be equal to the current number of site collections.

  4. 4. Change the Number of sites before a warning event is generated setting to be one less that the current number of site collections.

More info

You have seen how to do this recipe through the user interface. There is a way to do the same procedure through scripting. PowerShell is the new way of scripting, but the stsadm command set is still available. Here are both methods:

  • Using stsadm command:

    stsadm -o createsiteinnewdb -url <url> -owneremail <email> -ownerlogin <domain/name> -sitetemplate <site template> -title <title> -databaserver <serverdb> -databasename <dbname>
    
  • Using PowerShell, we need to run the following two commands:

    New-SPContentDatabase
    New-SPSite
    
You have been reading a chapter from
Microsoft SharePoint 2010 Administration Cookbook
Published in: Jan 2011 Publisher: Packt ISBN-13: 9781849681087
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}