Skip to main content

Notifications

Announcements

No record found.

Small and medium business | Business Central, N...
Answered

SQL Log File Issue

Posted on by 195

Dear Experts:

Since we are using SQL DB, so I think this is the right place to post my issue.

When I deleted million of records of log entries table in Dynamics nav 2017, I surprised that the log file of SQL DB increased to a huge size eating the space of the hard disk.

So how to do now, how to reduce the log file size?



Plz Help


Thanks so much

  • Verified answer
    Family Corner Profile Picture
    Family Corner 195 on at
    RE: SQL Log File Issue

    Dears/

    Shrinking is working, thnx a lot

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 73,647 Super User 2024 Season 2 on at
    RE: SQL Log File Issue

    Hi, please try the following after you delete the records.

    pastedimage1667776730087v1.png

    Or

    DBCC SHRINKDATABASE (N'yourdatabase');

    More details: 

    https://learn.microsoft.com/en-us/answers/questions/422507/unable-to-relcaim-disk-space-after-deleting-the-re.html

    https://community.spiceworks.com/topic/2192343-how-to-reclaim-space-in-sql-after-deleting-records-from-tables

    Hope this helps as well.

    Thanks.

    ZHU

  • Suggested answer
    Inge M. Bruvik Profile Picture
    Inge M. Bruvik 32,748 Super User 2024 Season 1 on at
    RE: SQL Log File Issue

    Please refer to the SQL doc on how you shrink your log file. Going through a backup / restore is not necessary:

    learn.microsoft.com/.../manage-the-size-of-the-transaction-log-file

    You can use SQL management studio or the DBCC Shrinkfile command

  • Suggested answer
    Amit_Sharma Profile Picture
    Amit_Sharma 2,545 on at
    RE: SQL Log File Issue

    Hi,

    Take Backup of database in external hard disk and then delete the log file and create new log file. for this refer the below link

    https://erpconsultors.com/attach-mdf-file-without-ldf-file-by-using-ssms/

    Regards

    Amit Sharma

    www.erpconsultors.com

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans