How to purge Transaction Log

  • Hi,

    I tried many thing to purge transaction log as suggested on google,But its size does not reduce.

    Plz Help.How to do it?

    Thanks.......
    -----------------------------------
    My Blog[/url] | Articles

  • Do you mean Shrinking the Transaction Log? What is the recovery model of the database?

    If its Full, please take a tlog backup and then try to Shrink.

    You may also change the recovery model to Simple, take a full backup, shrink the transaction log, change recovery model to Full and take another Full backup.

    If above is not what you are looking for, please provide more details as to what you are looking for.

  • I am using Full Recovery Model.

    I tried to backup and shrink.But reduces only 1 GB space from 23 GB.

    I also tried these steps

    http://levicorp.com/2011/01/17/how-to-purge-vcenter-sql-server-transaction-log/[/url]

    Thanks.......
    -----------------------------------
    My Blog[/url] | Articles

  • Why are you shrinking your transaction log? If it grew to 23 GB due to normal activity then it will only grow again to the previous size and you'll be in the same situation in the future. Make sure you know why you're shrinking the log before you do. If it grew because of a one-off operation and you want to reclaim space, fine, shrink it one time. But if this is a common occurrence then you need to rethink how you're doing things and you can start by reading this article to learn more about the log and how to manage it:

    Managing Transaction Logs By Gail Shaw[/url]

    There are no special teachers of virtue, because virtue is taught by the whole community.
    --Plato

  • If its really needed to shrink I would use below:

    backup log dbname to disk ='..\log.trn'

    dbcc shrinkfile(filename)

    I would also follow below if above doesn't help

    - Backup DB

    - Change the recovery model to Simple

    - Shrink the file (may be with dbcc shrinkfile...)

    - Change the recovery model back to FULL

    - Take a Full backup of the database.

Viewing 5 posts - 1 through 4 (of 4 total)

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