SharePointforAll
This is the best place to find out everything that Quest is doing around SharePoint, plus where we will give guidance on all things SharePoint
Top 10 Benefits of Test-SPContentDatabase PowerShell Command in SharePoint 2010
SharePoint Community Experts

Syndication

News

  • The Experts Conference for SharePoint 2010 – Intense 400-Level Training for the Experts, by the Experts Join Quest and Microsoft for The Experts Conference (TEC) 2010, an important training event focused on delivering intense, 400-leavel training to the most experienced SharePoint users. TEC 2010 brings out the industry’s leading experts and Microsoft product team leadership for three straight days. Featuring Microsoft keynote Bill Baer and top industry experts like Joel Oleson, Michael Noel, Rick Taylor, and Mike Watson -- TEC for SharePoint promises unprecedented depth and laser focus on SharePoint 2010. TEC for SharePoint happens April 25-28, 2010, at the JW Marriott LA Live Hotel in the heart of Los Angeles. Interested in speaking at TEC in the future? Contact stella.lowe@quest.com. TEC Europe is coming in the Fall of 2010. Be sure to ask Stella for details on timing and abstract requirements as well! Learn more at www.tec2010.com

Archives

Benefits of Test-SPContentDatabase Powershell Command, while a powerful command for upgrade it’s not just for upgrade.  It’s a new tool in your SharePoint toolbox used in all phases of a SharePoint deployment.

1. Content database insight from SharePoint 2010 – You can run the test-spcontentdatabase at any time to get insight on your content databases, and hence not only benefits your ability to discover issues before upgrade, but also after upgrade and should be used as a commandlet that you use for validation for both database attach and in place as a post upgrade validation.

2. Complements pre-upgrade checker report – PreUpgradeCheck is an awesome command.  It should be used on all 2007 farms as often as you can, but once the data is on 2010 you don’t have that command.  The Test-SPContentDatabase gives you the ability to check against the servers in the new farm and can be used to identitify unique issues to the each of the servers in the farm.  It definitely can be used in compliment with preupgradecheck and should be.  Any database attach commands should include both preupgrade check on the source and test-spcontentdatabase on the destination.  There’s nothing keeping you from running this command and preupgrade check and to compare results.

3. Reports data from server/database pairing – Not only do you get farm level information, but you get much more specific stats about the status of individual servers when running the test-spcontentdatabase on each server in the farm.  The output is specific to the server.

4. Compares against a specific web application – When preparing to attach a database you want to know the specifics to the features that may have been added to a specific web application and test-spcontentdatabase gives you that insight.

5. Identifies current or potential issues - Data orphans, Missing site definitions, Missing features, Missing assemblies

6. Can show table sizing metrics – Get metrics used for planning

7. Scans WSS 3.0, SharePoint 2007 and SharePoint Foundation, SharePoint 2010 content databases - Can be used to scan both SharePoint 2007 databases and 2010 database, so don’t throw away this command.  This commandlet should be part of any troubleshooting around issues that involve 2010.

8. Makes no changes to the database – It’s a read only operation.  Don’t be afraid of it trying to set flags or flipping bits.  There’s no changes… same with preupgradecheck.

9. Schedule it to monitor for problems – If you are trying to keep on top of issues related to files, orphans or other issues, you can schedule this commandlet to run on a recurring basis and review the reports.

10. Test Upgrade without running Upgrade – Without running the actual upgrade you can use the command to get a heads up way before hand, and since it’s read only, you can make changes to be better prepared and run it again and again as you fix and address issues.

 

Sample Results:

image

 

Syntax and Usage

You can get more information on the command in the help and usage including syntax.

Quoted from the beta 2 powershell commandlet help files for Test-SPContentDatabase

 

“NAME
Test-SPContentDatabase

SYNOPSIS
Tests a content database.

SYNTAX
Test-SPContentDatabase -Name -WebApplication [-AssignmentCollection ] [-DatabaseCredentials ] [-ServerInstance ]

DESCRIPTION
The Test-SPContentDatabase cmdlet tests a content database.

PARAMETERS
-Name
Specifies the existing content database to test.

The type must be a valid name of a SharePoint content database; for example, SPContentDB1.

-WebApplication
Specifies the SharePoint Web application to use to test the content database.

The type must be a valid GUID, in the form 12345678-90ab-cdef-1234-567890bcdefgh; or a valid name of SharePoint Web application (for example,
MyOfficeApp1); or an instance of a valid SPWebApplication object.

-AssignmentCollection
PShell_param_AssignmentCollection

PShell_param_AssignmentCollection_Note

-DatabaseCredentials
Specifies the PSCredential object that contains the user name and password to be used for database SQL authentication.

The type must be a valid PSCredential object.

-ServerInstance
Specifies the instance of the database service to use to test the specified content database.

The type must be a valid GUID, such as 12345678-90ab-cdef-1234-567890bcdefgh; a valid name of a SQL Server instance (for example, DBSvrInstance1); or an instance of a valid SPDatabaseServiceInstance object.

This cmdlet supports the common parameters: Verbose, Debug, ErrorAction, ErrorVariable, WarningAction, WarningVariable, OutBuffer and OutVariable. For more information, type, "get-help about_commonparameters".

 

Add code example

 

REMARKS
To see the examples, type: "get-help Test-SPContentDatabase -examples".
For more information, type: "get-help Test-SPContentDatabase -detailed".
For technical information, type: "get-help Test-SPContentDatabase -full".”

Closed Quote

 

Additional info and resources on Test-SPContentDatabase on SharePointJoel.com


Posted Tue, Jan 12 2010 4:55 PM by Joel Oleson

Comments

Thailand Hotels wrote re: Top 10 Benefits of Test-SPContentDatabase PowerShell Command in SharePoint 2010
on Mon, Feb 22 2010 12:13 PM

I like this article. This is called a great article. I am new here. I like your site too. This is pretty awesome. i found some useful info here. anyways thanks for sharing with us. I am looking foreword your next post. Thanks. I’m just going to shear this site all my friend’s and i hope they live this site.

ujyorhj wrote re: Top 10 Benefits of Test-SPContentDatabase PowerShell Command in SharePoint 2010
on Wed, Mar 17 2010 12:46 AM

URzxOo  <a href="akxbtlryswei.com/.../a>, [url=http://hscnubgnvksf.com/]hscnubgnvksf[/url], [link=http://qsogovrzbvyu.com/]qsogovrzbvyu[/link], http://tamjkkenptek.com/

(c) 1987-2010 Quest Software Inc.
Powered by Community Server (Non-Commercial Edition), by Telligent Systems