2

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?

6 Answers 6

3

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).

3

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" />

2

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.

1
  • yeah, I made sure I deleted it from the second stage, and from the "Deleted from End User Recycle Bin"
    – Mike
    May 19, 2010 at 15:02
2

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.

2

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/

1

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.

2
  • That isn't an option I find in my site settings...
    – Mike
    May 19, 2010 at 16:47
  • 1
    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, 2010 at 19:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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