locked
How do i delete most - 90% - of the data from a sharepoint content db log db? RRS feed

  • Question

  • Hi,

    The log db of my content db is full of useless data and is eating up drive space - how can i delete most of the info from the log db?

    Cant do it using sql management studio...powershell?

    Thanks!

    Friday, March 22, 2019 5:03 PM

Answers

  • You need to take a transaction log backup and you will then be able to shrink the log (LDF) file.

    If you're using the Full Recovery model (which it sounds like you are), you should regularly schedule trn backups. The alternative would be setting the database to Simple recovery model. You would do this in a scenario where you're not using high availability (e.g. AOAG) and do not require point-in-time recovery.


    Trevor Seward

    Office Servers and Services MVP



    Author, Deploying SharePoint 2016

    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    Friday, March 22, 2019 6:26 PM

All replies

  • You need to take a transaction log backup and you will then be able to shrink the log (LDF) file.

    If you're using the Full Recovery model (which it sounds like you are), you should regularly schedule trn backups. The alternative would be setting the database to Simple recovery model. You would do this in a scenario where you're not using high availability (e.g. AOAG) and do not require point-in-time recovery.


    Trevor Seward

    Office Servers and Services MVP



    Author, Deploying SharePoint 2016

    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    Friday, March 22, 2019 6:26 PM
  • Hi ariffieo, 

    If Trevor's reply helps you, please remember to mark it as an answer, it will be beneficial to others in the community who meet this similar issue in the future. 

    Thanks for your understanding. 

    Best Regards, 

    Lisa Chen

    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Monday, March 25, 2019 8:10 AM
  • Thanks Trevor - I did some research on this over weekend and of course you are right...

    I have some SharePoint dbs in simple recovery and some in full...

    Does it make any difference to SharePoint which one is used ie simple or full?

    I know it makes a difference on the restore -  but what about on day to day operations? Does SharePoint have a preference for the recovery model?

    I can write this as a new question if you want as I think it best practice in forums...

    Monday, March 25, 2019 11:20 AM
  • SharePoint has no preference with the exception of the Usage database which should always be in Simple mode (it cannot be part of a high availability solution outside of traditional SQL clustering).

    Trevor Seward

    Office Servers and Services MVP



    Author, Deploying SharePoint 2016

    This post is my own opinion and does not necessarily reflect the opinion or view of Microsoft, its employees, or other MVPs.

    Monday, March 25, 2019 3:51 PM
  • Hi xyz2012,

    We encourage people who ask the question to mark a reply as an answer. It would be better if you could mark the helpful post as an answer. 

    Thanks for your understanding. 

    Best Regards,

    Lisa Chen


    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    SharePoint Server 2019 has been released, you can click here to download it.
    Click here to learn new features. Visit the dedicated forum to share, explore and talk to experts about SharePoint Server 2019.

    Tuesday, March 26, 2019 1:43 AM
  • Sorry i thought i had marked it as an answer...
    Thursday, March 28, 2019 5:37 PM