Emptying a verrrrry large SharePoint recycle bin

Let’s say you have a document library with 140,000 documents in it totalling 78 gigabytes. Sounds like a reasonable situation to me. After extended effort and various contortions (read here if you really care), you finally manage to delete the doclib in one swell foop. You then delete it from the site’s recycle bin so your backup will end before the Second Coming. Job done, and it’s back to figuring out if the Gators will jump over Oklahoma int the BCS standings if they win the SECCG.

Only it’s not, of course. The deleted uberlibrary just got shifted into the second stage recycle bin, where it’s still taking up space in the database and causing multi-tape backups. Ok, so you go to the Site Collection Recycle Bin and delete it. Seconds later, the user complaints come rolling in because SharePoint is not responding. Umpteen minutes later, the delete finally times out and you’re back where you started, except everybody is mad at you.

So what do you do? I tried going to Central Administration > Application Management > Web Application General Settings > Recycle Bin and turning “Second state Recycle Bin” to “Off”. Another long timeout (at least it doesn’t bring SharePoint to its knees) without deleting the offending doclib. I set “Delete items in Recycle bin After xx days” to “1″, but I have no clue when SharePoint will attempt to enforce the limit, or whether everything will grind to a halt when it does. I searched the options for stsadm, but could find nothing except what is already available in the gui. I’m strongly tempted to set “Recycle Bin Status” to “Off”, but I’m told that will clobber everybody’s site recycle bin, an act that will trigger a change of my address to the doghouse.

I wish I knew how to increase the timeout; I would just let the delete run all night. I assume there is a way to get to the recycle bin via SQL statements, but I have to believe that all data is encrypted or else there is no point to SharePoint’s document security. I’m out of ideas.

UPDATE: I used stsadm to set the SharePoint timeout to an obscenely long value like this

stsadm -o setproperty -pn database-command-timeout -pv 360000 -url http://My-blankety-blank-hostname

and tried emptying the offending doclib from the recycle bin again. It ran for two hours before terminating with the ever-so-helpful “an unknown error has occurred” message. If you try this at home, I recommend you do it after hours, because SharePoint won’t respond to a single user while it’s grinding away. So back to the drawing board for me.

UPDATE: For the “solution” I used, read this.

4 Responses to “Emptying a verrrrry large SharePoint recycle bin”

  1. Dennis C says:

    Hi,

    Thanks for this blog post– how did this story end? We are in exactly the same situation!

  2. cwogle says:

    I updated the post to include a link to the “solution” I used.

  3. pumaman78 says:

    I tried to click the link to the solution and i received an error stating “you are unable to edit this post” I don’t want to edit it, i just want to read it!

  4. cwogle says:

    Sorry about that, pumaman. I have updated the update, so try it again, please.

Leave a Reply