Have you ever been in a situation where the second stage library has a folder that is very large say about 56 GB. And it cannot be deleted because the database locks during deletion and the site becomes inaccessible. The process eventually times out and the site access resumes, but the item remains in the second stage recycle bin.
Then this article might be helpful....read on
First lets get a little familiar with the terms used
Users can delete it from here or restore the item back
Site collection Administrators can delete it from here or restore the item back
Some helpful articles
How does deletion work
When you delete an item from a Web site, the item is sent to the site's Recycle Bin. If you click Recycle Bin on the Quick Launch, you can see all of the items that you've deleted from your site. You can either restore or delete the item from the Recycle Bin. When you delete an item from the Recycle Bin, the item is sent to the Site Collection Recycle Bin. When an item is deleted from the site collection recycle bin (manually or automatically) the item is flushed from the content database. Other wise it remains in the database. Only one flag
When you delete an item from a Web site, the item is sent to the site's Recycle Bin. If you click Recycle Bin on the Quick Launch, you can see all of the items that you've deleted from your site. You can either restore or delete the item from the Recycle Bin. When you delete an item from the Recycle Bin, the item is sent to the Site Collection Recycle Bin.
When an item is deleted from the site collection recycle bin (manually or automatically) the item is flushed from the content database. Other wise it remains in the database. Only one flag
Few thoughts that crossed my mind
Here's what i found
There are certain things that can be done to avoid this situation
1. Restore the problem library to its original location. Delete the documents few at a time. Flush the second stage recycle bin periodically. By default the below command will show the period at which the recycle job will be run STSADM -o getproperty -propertyname job-recycle-bin-cleanup -url http://<sitename> Run the below command to run the recycle timer job periodically STSADM -o setproperty -propertyname job-recycle-bin-cleanup -propertyvalue "<configure a convenient time>" -url http://<site name> 2. Disable Second stage recycle bin from the central administration page Go to Central Administration > Application Management > Web Application General Settings Set Recycle Bin > Second stage Recycle Bin > OFF Note: This will flush the items in the second stage recycle bin for site collections in that web application. This is a web application level setting. On enabling second stage recycle bin the items will be removed from the recycle bin. The files are deleted from the database so it cannot be retrieved. 3. A custom code based on SharePoint Object Model can be used to flush the large files from the second stage recycle bin. Sample code SPSite site = new SPSite(<<siteurl>>); SPWeb web = site.RootWeb; SPRecycleBinQuery q = new SPRecycleBinQuery(); q.RowLimit = Int32.Parse(<<number of items to be deleted>>); q.OrderBy = SPRecycleBinOrderBy.Default; SPRecycleBinItemCollection itemColl = web.GetRecycleBinItems(q); foreach (SPRecycleBinItem item in itemColl) { Guid[] id = new Guid[1]; id[0] = item.ID; itemColl.Delete(id); } Disclaimer: The sample code provided is on "AS IS" basis with no warranties, and confers no rights.
1. Restore the problem library to its original location. Delete the documents few at a time. Flush the second stage recycle bin periodically.
By default the below command will show the period at which the recycle job will be run STSADM -o getproperty -propertyname job-recycle-bin-cleanup -url http://<sitename>
Run the below command to run the recycle timer job periodically STSADM -o setproperty -propertyname job-recycle-bin-cleanup -propertyvalue "<configure a convenient time>" -url http://<site name>
2. Disable Second stage recycle bin from the central administration page Go to Central Administration > Application Management > Web Application General Settings Set Recycle Bin > Second stage Recycle Bin > OFF
Note: This will flush the items in the second stage recycle bin for site collections in that web application. This is a web application level setting. On enabling second stage recycle bin the items will be removed from the recycle bin. The files are deleted from the database so it cannot be retrieved.
3. A custom code based on SharePoint Object Model can be used to flush the large files from the second stage recycle bin.
Sample code
SPSite site = new SPSite(<<siteurl>>); SPWeb web = site.RootWeb;
SPRecycleBinQuery q = new SPRecycleBinQuery();
q.RowLimit = Int32.Parse(<<number of items to be deleted>>); q.OrderBy = SPRecycleBinOrderBy.Default;
SPRecycleBinItemCollection itemColl = web.GetRecycleBinItems(q); foreach (SPRecycleBinItem item in itemColl) { Guid[] id = new Guid[1]; id[0] = item.ID; itemColl.Delete(id); }
Disclaimer:
The sample code provided is on "AS IS" basis with no warranties, and confers no rights.