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?

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
Transact-SQL
Transact-SQL
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
    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

  2. 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

  3. PandaPan-MSFT 1,906 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

  4. 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