Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I deleted everything from a site collection recycle bin and remote into the SQL server the content database is located and the sucker didn't get smaller. I had about a good 2 or 3 gigs of files in the recycle bin. I just want to make sure that it is getting deleted.

Is there something I am missing? Or does the SQL server not update file sizes properly?

share|improve this question
add comment

6 Answers

up vote 3 down vote accepted

SharePoint will NOT shrink the actual SQL Server database files. Removing items in SharePoint will delete the files (after passing the recycle bin procedure as Lori says) and free up space within the file which makes room for new files - without expanding the database files.

You can shrink the database files if you need to (probably get shot by saying this by the SQL Server mafia).

share|improve this answer
add comment

It's make me to laugh sometime when i look at SharePoint the way programmed. My scenario really sucks, We have a huge 1.3 Tera (single) content database, and we thought we need reduce the size the share point be faster,

We planned to create a custom to archive old content/documents to the separate record center and it's archived, here comes the truth the record center sucked more than 400 Gigs of data, When we look into the old SharePoint portal (assuming content db would have reduced) - turned nope it's not

It is same as it was earlier. Now dying with storage.

What is the cleaner way to delete a document or any other content from a library. My Question is, if you program it to delete a file as SharePoint way

SPFile.Delete();

It ideally calls the internal delete function to delete from the database.

But i found out one more interesting stuff,

SharePoint maintains everything in database - just digg around, i found the entry for the specific file resides in a so called table name : dbo.AllDocs

try to filter with DirName column - SPFolder.Url in SharePoint LeafName column - SPFile.Name in SharePoint

SELECT *
  FROM [<DatabaseName>].[dbo].[AllDocs]
  WHERE DirName LIKE '<Your Folder URL>'

after lots of hours past i found a microsoft technet suggested to use http://technet.microsoft.com/en-us/library/dd789569.aspx Job-gradual-site-deletion: STSADM property, and it says applies to SharePoint Server 2007.

actually if you run STSADM -HELP SETPROPERTY/GETPROPERTY in 12 Hive of SharePoint Server THERE IS NO SUCH PROPERTY EXISTS IN STSADM COMMANDLET

try

STSADM -O GETPROPERTY -PROPERTYNAME JOB-GRADUAL-SITE-DELETION

returns <Property Exist="No" />

share|improve this answer
add comment

Wictor is correct. It´s by design that the SQL database doesnt get smaller after deleting files. But if you wan´t to reduce the content database you can do the following:

1.Remove documents/sites etc. from the website. 2.make a sharepoint backup of the site 3.Create a new web application 4.Run a sharepoint restore to the new web application (5. you can detach and attach the databases to get the smaler database back on the first web application if you like to). For more info, see:

http://sharepointkaos.wordpress.com/2013/08/15/reduce-the-size-of-the-sharepoint-content-database-without-shrinking-it/

share|improve this answer
add comment

Are you deleting them from your recycle bin or the second stage recycle bin? The second stage recycle bin is allowed above your quota. Make sure you have a backup of the content before you delete from this second stage recycle bin, though, in case you have a need for this content in the future.

share|improve this answer
    
yeah, I made sure I deleted it from the second stage, and from the "Deleted from End User Recycle Bin" –  Mike May 19 '10 at 15:02
add comment

This is a little naive, but do you have versioning set up in any of your libraries? If so, you may need to clean out some of the old versions. You can the storage space allocation of each component by going to your top-level site and selecting Site Actions > Site Settings > Storage Space Allocation. You can then view the size of each library and list, as well as each document and the Recycle Bin.

share|improve this answer
    
That isn't an option I find in my site settings... –  Mike May 19 '10 at 16:47
    
Only Site Collection Administrators can see this option. This means you are NOT a Site Collection Admin. You can, however, ask the SCA to look at the Storage Space Allocation and delete where needed. –  Anonymous Jun 15 '10 at 19:16
add comment

Gradual site deletion isn't to do with removing things from the recycle bin. It is for entire site removal. When you remove a site collection by let's say Powershell for instance then the command immediately returns by default. What has happened is the site collection is marked for deletion and removed by a timer job at a later date.

Gradual removal isn't really relevant to the original problem posted.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.