Shrink Log file in simple mode not working

Surendra Adhikari 211 Reputation points
2022-10-18T01:41:36.377+00:00

To shrink the log file of a database, I changed the mode to simple and executed the shrinkfile command but the file does not get shrinked. Why is it so even in simple recovery mode?

Developer technologies Transact-SQL
SQL Server Other
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. T. Kujala 8,761 Reputation points
    2022-10-18T03:44:24.813+00:00
    0 comments No comments

  2. Olaf Helper 47,436 Reputation points
    2022-10-18T04:52:08.907+00:00

    What does

    select name, log_reuse_wait_desc  
    from sys.databases  
    

    return for the database in mind? Is there logshipping, replication or etc. setup for the database?

    0 comments No comments

  3. Surendra Adhikari 211 Reputation points
    2022-10-18T05:07:36.69+00:00

    Executing checkpoint before shrinkfile helped.
    Thank you all for replies.

    0 comments No comments

  4. PandaPan-MSFT 1,931 Reputation points
    2022-10-18T05:27:34.997+00:00

    Hi @Surendra Adhikari ,
    If you wanna shrink file in the simple mode, you need to truncate the log. To execute checkpoint is a way and you can also do the full backup, which will have the same effect. :)


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment"

    0 comments No comments

  5. Rajeev Soni 1 Reputation point
    2022-10-19T02:09:35.913+00:00

    Use Checkpoint before running the shrink command. Thanks

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.