Monday, April 7, 2014

Remove Site Collection and Reclaim Database Disk Space

Scenario
  • You need to remove a large site collection from your content database.
  • SharePoint 2010 or higher
Resolution
  • Use PowerShell after hours to remove the site collection:
     
    Remove-SPSite –Identity http://sitename
     
  • If you are on 2010 SP1 or later and if you used Central Admin or the SharePoint UI instead of the above PowerShell command or if you specified the -GradualDelete flag, then you must use PowerShell to remove the site collection from the recycle bin and then run the "Gradual Site Delete" timer job (or wait overnight for scheduled job), otherwise skip this step: 

    Get-SPDeletedSite -webapplication http://sitename | Remove-SPDeletedSite
     
  • Wait a few minutes for the database size to finish reducing (monitor via SQL Management Studio)
     
    Perform a FULL database backup on the content database (this will truncate the log files)
     
  • Then shrink the database via SQL command in SQL Management Studio:
     
    DBCC SHRINKDATABASE ('database_name' ,5 , NOTRUNCATE)
     
  • Then reorganize the indices (this should run automatically every day, but you can kick it off manually now):
     
    Run the following from Central Admin Health Analyzer (/Lists/HealthRules/AllItems.aspx) using Run Now:
     
    Databases used by SharePoint have fragmented indices

45 comments:

  1. I Just Love to read Your Articles Because they are very easy to understand US Medical Residency thanks for posting

    ReplyDelete
  2. Really Thanks For Sharing Such an Informative and Knowledgeable Post Coming to Ourself We Provide Lombard Immediate Care in Us.Really Thanks For Posting Such an Useful and Informative Content.

    ReplyDelete
  3. Really Thanks For Sharing Such an Informative Post....

    Vizag Real Estate

    ReplyDelete
  4. I am really very happy to find this particular site. I just wanted to say thank you for this huge read!! I absolutely enjoying every petite bit of it and I have you bookmarked to test out new substance you post.
    Click here:
    python training in chennai


    Click here:
    python training in tambaram

    ReplyDelete
  5. Hmm, it seems like your site ate my first comment (it was extremely long) so I guess I’ll just sum it up what I had written and say, I’m thoroughly enjoying your blog. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.

    AWS Interview Questions And Answers


    AWS Training in Bangalore | Amazon Web Services Training in Bangalore

    AWS Training in Pune | Best Amazon Web Services Training in Pune

    Amazon Web Services Training in Pune | Best AWS Training in Pune

    AWS Online Training | Online AWS Certification Course

    ReplyDelete
  6. A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article. I am learning a lot from you.
    angularjs online training

    apache spark online training

    informatica mdm online training

    devops online training

    aws online training

    ReplyDelete
  7. I am really thankful for posting such useful information. It really made me understand lot of important concepts in the topic. Keep up the good work!
    Oracle Training in Chennai | Oracle Course in Chennai

    ReplyDelete
  8. This comment has been removed by the author.

    ReplyDelete
  9. It’s always so sweet and also full of a lot of fun for me personally and my office colleagues to search your blog a minimum of thrice in a week to see the new guidance you have got.

    Best PHP Training Institute in Chennai|PHP Course in chennai
    Best .Net Training Institute in Chennai
    Oracle DBA Training in Chennai
    RPA Training in Chennai
    UIpath Training in Chennai

    ReplyDelete
  10. Thanks for sharing it.I got Very valuable information from your blog.your post is really very Informatve. I got Very valuable information from your blog.i provide aws certification .I’m satisfied with the information that you provide for me.




    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. This comment has been removed by the author.

    ReplyDelete
  13. Effective blog with a lot of information. I just Shared you the link below for Courses .They really provide good level of training and Placement,I just Had SharePoint Developer Classes in this institute , Just Check This Link You can get it more information about the SharePoint Developer course.

    Java training in chennai | Java training in annanagar | Java training in omr | Java training in porur | Java training in tambaram | Java training in velachery

    ReplyDelete
  14. I believe that your blog will surely help the readers who are really in need of this vital piece of information. Waiting for your updates.
    AWS training in chennai | AWS training in anna nagar | AWS training in omr | AWS training in porur | AWS training in tambaram | AWS training in velachery

    ReplyDelete
  15. This is really too useful and have more ideas and keep sharing many techniques.. oracle training in chennai

    ReplyDelete
  16. This information is impressive..I am inspired with your post writing style & how continuously you describe this topic.

    Apache Spark Training Institute in Pune
    Best AWS Training Institute in Pune

    ReplyDelete
  17. Infycle Technologies, the
    No.1 software training institute in Chennai
    offers the leading Python course in Chennai for tech professionals and students at the best offers. In addition to the Python course, other in-demand courses such as Data Science, Selenium, Oracle, Java, Power BI, Digital Marketing also will be trained with 100% practical classes. After the completion of training, the trainees will be sent for placement interviews in the top MNC's. Call 7504633633 to get more info and a free demo.

    ReplyDelete
  18. Reach to the best Python Training institute in Chennai for skyrocketing your career, Infycle Technologies. It is the best Software Training & Placement institute in and around Chennai, that also gives the best placement training for personality tests, interview preparation, and mock interviews for leveling up the candidate's grades to a professional level.

    ReplyDelete

  19. Excellent blog. Lots of useful information here, thanks for your effort!
    Real Estate Plots in Vizag

    ReplyDelete
  20. Very Informative blog thank you for sharing. Keep sharing.

    Best software training institute in Chennai. Make your career development the best by learning software courses.

    uipath course in chennai
    cloud computing training in chennai
    devops training in chennai

    ReplyDelete