I deleted a bunch of sites from my test site collection on SharePoint 2010. I need to empty all possible stages of the recycle bin to make the database as small as possible. I am currently stuck with one large site sitting in the Site Collection Recycle Bin > Deleted from end user Recycle Bin. The size of this site is about 30GB.
When I am using the UI and try to delete this site it is unresponsive for a while but when it comes back the site is still there. Then I found this Powershell script:
foreach ($SPSite in $webApp.Sites)
#get the collection of webs
foreach($SPWeb in $SPSite.AllWebs)
#Empty the 1st Stage Recycle bin items PERMENANTLY
#Send the 1st Stage Recycle bin items to 2nd Stage
write-host "End-User Recycle Bin Items Deleted for:"
write-host $SPWeb.title ":" $SPWeb.URL "`n"
#Empty SharePoint site collection recycle bin (2nd Stage Recycle bin) or Admin Recycle bin
write-host "Administrator Recycle bin Items Deleted for:" $SPSite.RootWeb.title "`n"
When I run it it gives me the following error:
Exception calling "DeleteAll" with "0" argument(s): "The instance of the SQL Server Database Engine cannot obtain a LOCK resource at this time. Rerun you
r statement when there are fewer active users. Ask the database administrator to check the lock and memory configuration for this instance, or to check f
or long-running transactions."
At line:18 char:42
+ $SPSite.RecycleBin.DeleteAll <<<< ();
+ CategoryInfo : NotSpecified: (:) , MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException
Not sure what to do with it. Any other ideas how to empty that recycle bin?