transaction log

  • Hello,

    What is the best way to truncate a transaction log in SQL Server 2005?

    Thank you,

  • If your database is in full recovery model, the best way to truncate the log is to back it up - frequently.

    If your database is in simple recovery model - there is nothing you need to do.

    Jeffrey Williams
    “We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”

    ― Charles R. Swindoll

    How to post questions to get better answers faster
    Managing Transaction Logs

  • Hi there best way is to

    1) dbcc opentran(datbasename) - this will show the oldest open transaction

    2) Kill this process

    3) backup log Database name with no_log

    4) use databases name

    5) dbcc shrinkfile(databasename_log,100) - shrinks the log back to 100mb

    then backup the database is full mode as it will be had to recover if you keep it backed up with nolog.

    Regards,

    Terry

Viewing 3 posts - 1 through 2 (of 2 total)

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