SQL Server 2008 R2 Enterprise Edition and SharePoint Server 2010 Better Together Whitepaper

A recently published whitepaper is now available on TechNet that describes the benefits of deploying Microsoft SharePoint Server 2010 on Microsoft SQL Server 2008 R2 Enterprise Edition and scenarios in which its features can be applied.

Excerpt

The adoption of Microsoft® SharePoint® Server 2010 can grow exponentially across an organization quickly gaining momentum and taking root as a critical part of an organization’s ecosystem. To help protect data, ensure availability, and keep costs down, we recommend that customers choose Microsoft® SQL Server® 2008 R2 Enterprise Edition during initial deployment.

Download the whitepaper today…

Office SharePoint Server 2007 and Project Server 2007 Virtual Migration Environment Released

We just posted a new Virtual Migration Environment for SharePoint Portal Server 2003 or Project Server 2003 customers looking to migrate/upgrade to Office SharePoint Server 2007 or Project Server 2007.

Overview

The Virtual Migration Environment is a set of two virtual disks that provide Office Project Server 2007 and Office SharePoint Server 2007 environments, sample content, and scripts design to assist customers with upgrade and migration from Office Project Server 2003 and Office SharePoint Portal Server 2003 to Project Server 2010 and SharePoint Server 2010. The Virtual Migration Environment provides the tools and resources to assist with upgrade and migration and planning and preparation resources to determine upgrade approaches and address common issues.

To download the virtual machine or learn more about the Virtual Migration Environment visit http://go.microsoft.com/?linkid=9729345.

Site Subscriptions in SharePoint 2010

New multi-tenancy features are an exciting concept in SharePoint 2010, particularly when considering the implications on hosting SharePoint for a variety of tenants, each requiring some method of partitioning, administration, and a method of reporting and control whether within the boundaries of an Enterprise or as a hosting provider.  In this post we’ll look at one of the layers of multi-tenancy in SharePoint 2010.

Site Subscriptions

SharePoint 2010 provides support for a concept known as site subscriptions.  Site subscriptions can be loosely described as a collection of sites that subscribe to a set of service partitions, settings, and individual features – site subscriptions are also known as tenants.  In summary we can approach site subscriptions as a loose association of content.  In the Object Model site subscriptions are represented through Microsoft.SharePoint.SPSiteSubscription.

The management of site subscriptions occurs through a new administration site template, Tenant Administration, that is used to manage many aspects of the site collections that subscribe from the subscription.

Creating a new site subscription object in SharePoint Server 2010 requires an administrator to:

  1. Create a SPSiteSubscription object
  2. Create and add a SPSite object to the SPSiteSubscription

Included below are both Windows PowerShell and Object Model examples that will enable the creation, assignment, identification, and deletion of site subscriptions in SharePoint 2010.

Creating Site Subscriptions with Windows PowerShell

Create a Site Subscription

$subscription=New-SPSiteSubscription

Create a Tenant Administration Site

$site=New-SPSite –Url http://<server>/<path>/<site&gt; –Template TenantAdmin#0 –OwnerEmail someone@example.com –OwnerAlias <domainuser> –SiteSubscription $subscription

Optionally when using an existing Tenant Administration site you can use:

$site=Get-SPSite http://<server>/<path>/<site&gt;

Set-SPSite –Identity $site –SiteSubcription $subscription

Assign the Tenant Administration Site

Set-SPSiteAdministration –Identity http://<server>/<path>/<site&gt; –AdministrationSiteType TenantAdministration

Upon completion of the steps above (or below) you will have a new Tenant Administration site collection that will appear similar to the illustration below (click to enlarge).

image

On the Tenant Administration site collection select Manage Site Collections under SharePoint Sites to manage the properties of existing site subscription member site collections or add new sites to the site subscription (requires Self-Service Site Creation to be enabled on the Web application).

image

Creating Site Subscriptions through the Object Model

// Get an existing Tenant Administration Site
using (SPSite site = new SPSite("
http://<server>/<path>/<site>"))
{
    // Create a Site Subscription
    SPSiteSubscription subscription = SPSiteSubscription.CreateSubscription();
   
// Add the Tenant Administration Site to the Site Subscription
    subscription.Add(site);
}

Locating a Site Subscription with Windows PowerShell

Get-SPSiteSubscription –Identity http://<server>/<path>/<site&gt;

Optionally to get all site subscriptions you can use:

Get-SPSiteSubscription

Location a Site Subscription through the Object Model

The SPFarm.SiteSubscriptions property can be used to get all site subscriptions available in the farm.  For additional information on the SPFarm.SiteSubscriptions property see also http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.administration.spfarm.sitesubscriptions(office.14).aspx.

The SPSite.SiteSubscription property can be used to get the site subscription that the Site Collection is assigned.  For additional information on the SPSite.SiteSubscription property see also http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spsite.sitesubscription(office.14).aspx.

The SPContext.SiteSubscription property can be used to get the site subscription that the site collection is assigned.  For additional information on the SPContext.SiteSubscription property see also http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spcontext.sitesubscription(office.14).aspx.

Deleting a Site Subscription with Windows PowerShell

Remove-SPSiteSubscription -Identity //">//">http://<server>/<path>/<site>

Optionally to delete all site subscriptions you can use:

Get-SPSiteSubscription | Remove-SPSiteSubscription

Deleting a Site Subscription through the Object Model

// Get the Tenant Administration Site
using(SPSite site = new SPSite("
http://<server>/<path>/<site>"))
{
    SPSiteSubscription subscription = site.Subscription;
    subscription.Delete();
}

Backing up a Site Subscription

The last scenario in this post to managing site subscriptions is the backup scenario.  The following Windows PowerShell examples can be used to backup and restore site subscriptions.

Get the Site Subscription Id

$id=Get-SPSiteSubscription http://<server>/<path>/<site>

Backup all Site Collections in the Site Subscription

Get-SPSiteSubscription http://<server>/<path>/<site&gt; -ReturnSites | Backup-SPSite –Path “\<server><share>”+$_.Title+”.bak”

Backup the Site Subscription Settings

Export-SPSiteSubscriptionSettings –id $id –path “\<server><share><subscription>_settings_backup”

NOTE

http://<server>/<path>/<site&gt; represents the full path to the Tenant Administration site collection.  Restoring a site subscription and its member sites is the opposite of the above, I.e. Import-, etc.

Database Mirroring in SharePoint 2010

Database mirroring provides an additional layer of resiliency, specifically, in highly available architectures, by providing a level of granularity not available to failover clustering.  For additional information on database mirroring see also http://technet.microsoft.com/en-us/library/ms189852.aspx (SQL Server 2008) or http://technet.microsoft.com/en-us/library/ms189852(SQL.90).aspx (SQL Server 2005).

In Office SharePoint Server 2007 database mirroring was a complex to implement, primarily due to the fact that our connection strings were both in managed code and the unmanaged SQL layer which required an administrator deploying database mirroring to leverage SQL Server Client Connection Aliases across front-end Web and application servers – beyond that – database mirroring in Office SharePoint Server 2007 also required databases as principal to maintain node majority, meaning all databases as principal had to reside on the same instance and subsequently failover had to occur moving all databases as a single unit.  In Office SharePoint Server 2007 a database connection string would appear as Data Source=<Database Server>;Initial Catalog=<Database>;Integrated Security=True;Enlist=False;Connection Timeout=15, so in the event SQL Server Client Connection Aliases were not implemented an administrator, through code or through detaching and reattaching the databases, would need to update the connection string(s) to specify the new database server where the databases as principal reside post-failover.

When using connection aliases it was also important to ensure the configuration specified the port on which the database server listened due to changes in DBNETLIB.

DBNETLIB

In Office SharePoint Server 2007 to avoid connection interrupts it was important to specify the port that the SQL Server listened on.  SQL Server clients use DBNETLIB to perform port detection and handles the protocol preference order when secondary protocol attempts are necessary.  When you enable the Client Configuration Utility, no port number is stored for the alias entry and DBNETLIB attempts to contact the server through a known UDP port to obtain the correct connection information – over time this can result in connection interrupts.

Additional Information

http://msdn.microsoft.com/en-us/library/aa177042(SQL.80).aspx

http://support.microsoft.com/kb/816649

In SharePoint Server 2010 support for database mirroring is provided natively enabling seamless and automatic (depending on Operating Mode) failover, in comparison, in SharePoint Server 2010 a database connection string would appear as Data Source=<Principal Database Server>;Failover Partner=<Mirror Database Server>;Integrated Security=True;Enlist=False;Connection Timeout=15.

With that said in SharePoint Server 2010 we have an ADO.NET connection object,  so in the event the primary connection string cannot connect, the ADO.NET connection string object will attempt the secondary connection string.  The failover time will vary depending on a number of conditions to include network conditions; however, in most cases when operating in the High Availability mode the connection at the SQL layer is updated within seconds, minimizing the impact of failover on end users; in High Safety and High Performance operating modes, ADO.NET will attempt the primary connection string until the specified timeout threshold has been reached prior to attempting the secondary connection string.

Configuration

In many cases the SharePoint 2010 Central Administration user interfaces exposes entry points used to configure the failover partner in a database mirroring session; however, some database (i.e. Configuration) database do not have a UI entry point – in these scenarios you can use Windows PowerShell or the Object Model to configure the failover partner for the selected databases (examples follow):

SharePoint 2010 Central Administration (Content Database)

To configure a content database for database mirroring through SharePoint 2010 Central Administration:

  1. On the SharePoint 2010 Central Administration Home page select Manage content databases under Application Management.
  2. Select the Web application which the content database is associated from the Managed Content Databases page and then select the database to be configured from the list of available content databases.
  3. On the Manage Content Database Settings page specify the failover partner in the field labeled Failover Database Server and click OK.

NOTE

When using a DBA-created database, you can specify the failover database server in the Failover Database Server field when adding new content databases through the SharePoint 2010 Central Administration user interface, Windows PowerShell, or the Object Model.

Prior to configuring a database for database mirroring with SharePoint Server 2010 the database should first be configured for database mirroring on the SQL Server.  For additional information on configuring databases for database mirroring with SQL Server see also http://technet.microsoft.com/en-us/library/ms190941.aspx (SQL Server 2008) or http://technet.microsoft.com/en-us/library/ms190941(SQL.90).aspx (SQL Server 2005).

image

SharePoint 2010 Central Administration (Service Application Databases)

Service Applications vary in their respective UI entry points, most commonly, the failover partner can be specified through the properties dialog for most Service Applications.  For those Service Applications with specialized management user interfaces, such as Search, database mirroring can be configured through those pages.

  1. On the SharePoint 2010 Central Administration Home page select Application Management.
  2. On the Application Management page select Manage service applications under Service Applications.
  3. On the Manage Service Applications page, select the Service Application to configure from the list of available Service Applications, and then select Properties from the Ribbon.
  4. On the properties dialog for the Service Application specify the failover partner in the field labeled Failover Database Server and click OK.

NOTE

When using a DBA-created database, you can specify the failover database server in the Failover Database Server field when creating new Service Application databases through the SharePoint 2010 Central Administration user interface, Windows PowerShell, or the Object Model.

Prior to configuring a database for database mirroring with SharePoint Server 2010 the database should first be configured for database mirroring on the SQL Server.  For additional information on configuring databases for database mirroring with SQL Server see also http://technet.microsoft.com/en-us/library/ms190941.aspx (SQL Server 2008) or http://technet.microsoft.com/en-us/library/ms190941(SQL.90).aspx (SQL Server 2005).

Windows PowerShell

The following example illustrates how a failover partner can be specified for a database through Windows PowerShell.

Param ([String]$database,[String]$server)

function Main()
{
  $db = get-spdatabase | where {$_.Name -eq $database}
  $db.AddFailoverServiceInstance($server)
  $db.Update()
}

Main

Object Model

The following example illustrates the Object Model syntax that can be used to specify a failover partner for a database.

string mirrorServer = ContentDatabaseSection.FailoverDatabaseServer;

SPDatabase db = GetDatabase();

db.AddFailoverServiceInstance(mirrorServer);

db.Update();