DATABASE

Sharepoint 2010 : Managing SharePoint Content Databases

2/18/2011 2:27:25 PM
Administrators should always keep an eye on the performance and storage of SharePoint backend databases. In response to the data they gather from the vast range of monitoring tools, administrators should also know how to manage SharePoint content databases, how to manually add a content database to a web application, and how to move a site collection between content databases. Some of these tasks can be completed directly from central administration; others can be done only via PowerShell or the deprecated STSADM command-line utility. These different tasks and techniques will be explained in detail in this section.

Adding a Content Database

Creating a new content database does not mean that any new content will be stored in it because a site collection cannot span content databases. However, by creating a new content database and following some extra steps, administrators can instruct SharePoint where to create new site collections.

Adding a Content Database Using Central Administration

Administrators can use the following procedure to create a new content database and attach it to the specified web application:

1.
Click Start, All Programs, Microsoft SharePoint 2010 Products, SharePoint 2010 Central Administration.

2.
On the SharePoint central administration website, click Application Management.

3.
In the Databases section, click Manage Content Databases.

4.
On the Manage Content Databases page, as shown in Figure 1, click Add a Content Database.

Figure 1. Manage Content Databases page in central administration.

5.
On the Add Content Database page, as shown in Figure 2, do the following:

A. Select a web application for the new database.

B. Select a database server to host the new database.

C. Specify the authentication method that the new database will use, and supply an account name and password, if they are necessary.

D. Specify both the total number of top-level sites that can be created in the database and the number at which a warning will be issued.

Figure 2. Add Content Database page in central administration.

6.
Click OK.

Adding a Content Database Using Windows PowerShell

Administrators can use the following procedure to create a new content database and attach it to the specified web application using Windows PowerShell:

1.
Click Start, All Programs, Microsoft SharePoint 2010 Products, SharePoint 2010 Management Shell.

2.
At the Windows PowerShell command prompt (PS C:\>), type the following command, and then press Enter:

New-SPContentDatabase -Name <String> -WebApplication <SPWebApplication-PipeBind>


The -Name parameter specifies the name of the content database to be created. The -WebApplication parameter specifies the web application to which the new database is to be attached.

Creating a Site Collection in a Specific Content Database

To force SharePoint to create new site collections in a specific content database, the target database should be the only one with the Ready status; all the other databases associated with the web application should be set Offline.

Taking a database offline means that from this point on, no new site collection will be created in that database. However, the database is still usable; users can still upload and download content, view web pages, and process workflows, and new subsites under an existing site collection can still be created in it. If a one-to-one site collection to content database association is needed, taking the hosting database offline is a method to accomplish this.

Note

Administrators should not leave the content databases in Offline mode for a long time; they should set the databases back to Ready after creating the new site collection because some timer jobs do not function properly when the database is in Offline mode.

Another approach to creating a site collection in a specific content database is to set the maximum number of sites in the target database to a large number. SharePoint will then choose this content database.


Setting a Content Database Offline Using Central Administration

Administrators can use the following procedure to set a content database offline using central administration:

1.
Click Start, All Programs, Microsoft SharePoint 2010 Products, SharePoint 2010 Central Administration.

2.
On the SharePoint central administration website, click Application Management.

3.
In the Databases section, click Manage Content Databases.

4.
On the Manage Content Databases page, select a web application by clicking the Web Applications drop-down list and choosing a web application.

5.
Click the database name in the list of the available database names.

6.
On the Manage Content Databases Settings page, as shown in Figure 3, change the database status to offline.

Figure 3. Manage Content Databases Settings page in central administration.

Creating a Site Collection in a Specific Content Database Using Windows PowerShell

To directly use the content database for a new collection using PowerShell, administrators can use the following procedure:

1.
Click Start, All Programs, Microsoft SharePoint 2010 Products, SharePoint 2010 Management Shell.

2.
At the Windows PowerShell command prompt (PS C:\>), type the following command, and then press Enter:

New-SPSite -Url <String> -OwnerAlias <String> [-ContentDatabase
<SPContentDatabasePipeBind>]

Note

As explained, administrators need to first add a content database and then force the creation of new site collections into it. This makes it a bit confusing afterward for administrators to determine where each site collection lives. Fortunately, SharePoint provides an easy way to figure out which site collection goes with what content database by selecting a site collection from the Site Collection List in central administration rather than relying on naming conventions when creating content databases.


Moving Site Collections Between Content Databases

There might be some situations when a site collection hosted within a content database is unexpectedly growing, and the database is approaching the 100GB limit recommended by Microsoft. At such times, administrators should manually move the growing site collections from the larger content database to another smaller one.

Determining the Size of the Source Site Collection Using Windows PowerShell

Administrators should always double-check that the destination hard disk can comfortably store the site collection data by determining the size of the site collection that is to be moved. The following procedure can be used to determine the size of a site collection:

1.
Click Start, All Programs, Microsoft SharePoint 2010 Products, SharePoint 2010 Management Shell.

2.
At the Windows PowerShell command prompt (PS C:\>), type the following command, and then press Enter:

Get-SPSiteAdministration –Identity http://ServerName/Sites/SiteName| ft Url,DiskUsed


Replace http://ServerName/Sites/SiteName with the name of the site collection.

Moving Site Collections Between Content Databases Using Windows PowerShell

Administrators can use the Windows PowerShell command Move-SPSite to move site collections between content databases:

1.
Click Start, All Programs, Microsoft SharePoint 2010 Products, SharePoint 2010 Management Shell.

2.
At the Windows PowerShell command prompt (PS C:\>), type the following command, and then press Enter:

Move-SPSite <http://ServerName/Sites/SiteName> -DestinationDatabase
<DestinationContentDb>

Replace http://ServerName/Sites/SiteName with the name of the site collection, and replace <DestinationContentDb> with the name of the destination content database.

Other  
  •  Sharepoint 2010 : Maintaining SQL Server in a SharePoint Environment
  •  Sharepoint 2010 : Monitoring SQL Server in a SharePoint Environment
  •  Database Availability Group Replication in Exchange Server 2010 : Load Balancing in Exchange Server 2010
  •  Database Availability Group Replication in Exchange Server 2010 : Comparing and Contrasting DAG Versus CCR/SCR/SCC
  •  SQL Server 2008: Managing Query Performance - Forcing Index Seeks
  •  Exchange Server 2010 : Deploying a Database Availability Group (part 4)
  •  Exchange Server 2010 : Deploying a Database Availability Group (part 3)
  •  Exchange Server 2010 : Deploying a Database Availability Group (part 2) - Suspending and Reseeding a Database
  •  Exchange Server 2010 : Deploying a Database Availability Group (part 1) - Creating the File Share Witness
  •  Database Availability Group Replication in Exchange Server 2010 : Understanding Database Availability Groups
  •  
    Video
    Top 10
    SG50 Ferrari F12berlinetta : Prancing Horse for Lion City's 50th
    The latest Audi TT : New angles for TT
    Era of million-dollar luxury cars
    Game Review : Hearthstone - Blackrock Mountain
    Game Review : Battlefield Hardline
    Google Chromecast
    Keyboards for Apple iPad Air 2 (part 3) - Logitech Ultrathin Keyboard Cover for iPad Air 2
    Keyboards for Apple iPad Air 2 (part 2) - Zagg Slim Book for iPad Air 2
    Keyboards for Apple iPad Air 2 (part 1) - Belkin Qode Ultimate Pro Keyboard Case for iPad Air 2
    Michael Kors Designs Stylish Tech Products for Women
    REVIEW
    - First look: Apple Watch

    - 3 Tips for Maintaining Your Cell Phone Battery (part 1)

    - 3 Tips for Maintaining Your Cell Phone Battery (part 2)
    Popular Tags
    Video Tutorail Microsoft Access Microsoft Excel Microsoft OneNote Microsoft PowerPoint Microsoft Project Microsoft Visio Microsoft Word Active Directory Exchange Server Sharepoint Sql Server Windows Server 2008 Windows Server 2012 Windows 7 Windows 8 Adobe Flash Professional Dreamweaver Adobe Illustrator Adobe Photoshop CorelDRAW X5 CorelDraw 10 windows Phone 7 windows Phone 8 Iphone