SPContentDatabase.ForceDeleteSite method (Guid, Boolean, Boolean)
Removes a site collection object from the content database when standard deletion methods are unusable.
Assembly: Microsoft.SharePoint (in Microsoft.SharePoint.dll)
'Declaration Public Sub ForceDeleteSite ( _ siteId As Guid, _ gradualDelete As Boolean, _ restorable As Boolean _ ) 'Usage Dim instance As SPContentDatabase Dim siteId As Guid Dim gradualDelete As Boolean Dim restorable As Boolean instance.ForceDeleteSite(siteId, gradualDelete, _ restorable)
public void ForceDeleteSite( Guid siteId, bool gradualDelete, bool restorable )
The GUID of the site collection that is deleted.
true to use gradual deletion (see Remarks), false to delete immediately.
true to retain the SPSite object in the Gradual Site Deletion Queue for the same retention period that is configured for the Recycle Bin of the parent web application, false to delete as soon as the object is at the top of the deletion queue.
restorable is true and either gradualDelete is false or the content database is an early SharePoint version that does not support restoration of deleted site collections.
Neither the WebDeleting nor the WebDeleted events, nor any other events, are raised by this method. Accordingly, no event handlers are executed by this method.
This method only removes the SPSite object from the content database. Artifacts of the site collection on the file system, if any, are not removed. Also, Active Directory accounts associated with the side are not deleted.
Passing true for gradualDelete reduces the performance impact of the deletion operation by causing the site collection content to be gradually deleted by a timer job. Gradual deletion causes rows in database tables to be deleted in small enough batches that SQL Server will lock only the affected rows, not the entire table.
The site collection is inaccessible immediately even if gradualDelete is true.