How can reduce database log file size

  • Hi,

    Is it possible to reduce database log file (.ldb file) ?
    Can you advise any method to reduce log file size.

    Regards
    Binu

  • First of all what size is the ldf file and also the mdf file?
    What recovery model is your database using? If it's full, how often are you backing your log up?

    Thanks

  • Hi,

    database created 1 month back
    file size
    mdf - 2.81
    ldf -  43 gb
    Fullback is taken one month back and no log backup is not taken yet.

    Regards
    Binu

  • Take a log backup as soon as you can then schedule regular log backups. Or if log backups aren't needed put the database in simple recovery.

    You should also take regular full backups.

    Thanks

  • binutb - Thursday, October 11, 2018 2:22 AM

    Hi,

    database created 1 month back
    file size
    mdf - 2.81
    ldf -  43 gb
    Fullback is taken one month back and no log backup is not taken yet.

    Regards
    Binu

    This is why. If you are going to leave your database in Full recovery model, you must take regular transaction log backups in order to curtail its growth. Alternatively since this isn't a business critical system by the look of it, you could just switch it to Simple recovery model (then do a one-off shrink of the log).

  • Is any way to reduce the current log backup size?

    Regards
    Binu

  • Run DBCC SQLPERF(LOGSPACE) It will show you how much of you log is actually free space. It's likely that most of it is unused so the backup size will be small.

    Thanks

  • Why is my log file full?

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Here is how can you reduce database log file. Shrink the database log file according to the recovery model:
    https://www.mssqltips.com/sqlservertutorial/3311/how-to-shrink-the-transaction-log/

Viewing 9 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic. Login to reply