SQL Server Log File is Consuming up to 600GB in my C drive.

Dan Kelly 0 Reputation points
2024-11-19T16:53:28.6533333+00:00

SQL Server Log File is Consuming up to 600GB in my C drive.

How do I remove or shrink the log file?

SQL Server
SQL Server
A family of Microsoft relational database management and analysis systems for e-commerce, line-of-business, and data warehousing solutions.
14,059 questions
{count} votes

Accepted answer
  1. LiHongMSFT-4306 28,576 Reputation points
    2024-11-20T02:18:34.16+00:00

    Hi @Dan Kelly

    How do I remove or shrink the log file?

    It is suggested to read this doc: Manage the size of the transaction log file.

    Best regards,

    Cosmog


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

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Bruce (SqlWork.com) 67,176 Reputation points
    2024-11-19T18:09:14.7633333+00:00

    normally a backup truncates the log. but you can manually truncate the log:

    BACKUP LOG databasename WITH TRUNCATE_ONLY

    but this will not recover space. if you are not doing backups, then you probably want simple recovery mode. this is truncate the log on checkpoints. then to recover the space, do a shrink database.

    ALTER DATABASE ExampleDB SET RECOVERY SIMPLE
    DBCC SHRINKFILE('ExampleDB_log', 0, TRUNCATEONLY)
    
    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.