How to delete a Site Collection that acts tough in SharePoint? [0x80070003]

by rahul 5/24/2012 12:58:39 PM

Well, you won’t get this issue often… but if you are reading this, the chances are high that you are working with SharePoint and a Site Collection that you want to delete is not getting deleted.

Symptoms

1. When you try to delete the site collection using Central Admin, you will not be able to select it using the site collection drop down.

image

2. When you try listing the Site Collection, a good site collection looks somewhat like this [notice the right part]

image

A bad site collection [also referred to as orphan site] looks somewhat like the following… [notice that the right part is now blank]

image

3. When you try deleting the site using the following command, stsadm -o deletesite -url http://server_name/sites/site_name you will get an error message.

The system cannot find the path specified. (Exception from HRESULT: 0x80070003)

Here is what I usually do to take care of this scenario [YMMV].

1. Run the following command, if you have the information available already.

stsadm -o deletesite -force -siteid 3331B673-727F-4AC3-BA2C-5BA44494E5B1 -databaseserver WFE1wSQL –databasename dotnetscraps_content_2

2. If you don’t have the highlighted information handy, here is how to get it.

    Open SQL Server Management Studio and select [USE] your SharePoint Config database.
    Execute a query…
      
Select id as SiteID, DatabaseID from SiteMap where Path like ‘%sites/testing’
[replace the like string appropriately]

    You should get only 1 row… [I got the following]

SiteID                                                                      DatabaseID
------------------------------------                   ------------------------------------
3331B673-727F-4AC3-BA2C-5BA44494E5B1    A5DAD965-C4CA-48B3-BE75-90FBB208AF21

    Execute another query…

Select name from Objects where id=’3331B673-727F-4AC3-BA2C-5BA44494E5B1’ 

    For me it gave me the database name… dotnetscraps_content_2
    Now, I am ready to go with the command.

stsadm -o deletesite -force -siteid 3331B673-727F-4AC3-BA2C-5BA44494E5B1-databaseserver WFE1wSQL -databasename dotnetscraps_content_2

So far in my experience, I usually get “Operation completed successfully” and I am ready to move ahead.

Hope this helps, Wave
Rahul


Quote of the day:
People who say they sleep like a baby usually don't have one. - Leo J. Burke


blog comments powered by Disqus

Rahul Soni

Rahul Soni  Twitter

 LinkedIn

 Facebook

 Email me



Vivek Kumbhar

Vivek Kumbhar  Twitter

 LinkedIn

 Facebook

 Email me


Stack Exchange

profile for Vivek at Server Fault, Q&A for system administrators and IT professionals

profile for Rahul Soni at Stack Overflow, Q&A for professional and enthusiast programmers

Calendar

<<  June 2013  >>
MoTuWeThFrSaSu
272829303112
3456789
10111213141516
17181920212223
24252627282930
1234567

View posts in large calendar

All Items
Sign in

Visit Microsoft's Site

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2013, Rahul Soni

Powered by BlogEngine.NET 1.4.5.0