Wednesday, March 13, 2013

SharePoint 2010 Missing Server Side Dependencies and SiteOrphan, Deleting the Orphaned Site

Recently I was working on a server that decided it was ready to start giving us problems.  When trying to create new site collections or sites SharePoint would error out and no site(s) would be created.  Checking the SharePoint Health Analyzer showed the all too familiar "Missing server side dependencies" error.  Opening this revealed all the sites that were never created, but were orphaned.  These errors look like this:

[SiteOrphan] Database [DATABASE_NAME] contains a site (Id = [SITE_GUID], Url = [RELATIVE_URL]) that is not found in the site map. Consider detach and reattach the database. The orphaned sites could cause upgrade failures. Try detach and reattach the database which contains the orphaned sites. Restart upgrade if necessary.
Now like any good SharePoint professional working in 2010, I went looking for the Powershell command that would clear this up.  Alas, there is none.  You'll need to use the good and trusty STSADM to handle this issue.  Luckily its quite simple, the following command will delete the offending site:

stsadm -o deletesite -siteid SITE_GUID -databaseserver DB_SERVERNAME -databasename DB_NAME -force 
The site guid and database name you can get from the Health Analyzer details, as it tells you both of these.  You'll just need to track down the database server name, which is easy.  Just navigate to Central Administration > System Settings > Manage servers in this farm.  That page will show you the database server with its name.

Enjoy!

No comments:

Post a Comment