Shrink Log file in simple mode not working

Surendra Adhikari 211 Reputation points

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?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
13,067 questions
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,577 questions
0 comments No comments
{count} votes

5 answers

Sort by: Most helpful
  1. Olaf Helper 42,386 Reputation points

    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

  2. Surendra Adhikari 211 Reputation points

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

    0 comments No comments

  3. PandaPan-MSFT 1,906 Reputation points

    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

  4. Rajeev Soni 1 Reputation point

    Use Checkpoint before running the shrink command. Thanks

    0 comments No comments