Results 1 to 5 of 5

Thread: How to clear transaction log

  1. #1
    Join Date
    Sep 2002
    Posts
    1

    How to clear transaction log

    I'm trying to clear a database transaction log that has gotten much too large. I backed it up hoping that this would clear the "active" log, but now I just have two copies of a huge transaction log. How do I clear the active log?
    Thanks in advance.

  2. #2
    Join Date
    Sep 2002
    Posts
    53
    use the dump tran command -

    you can dump your transaction log to a file or, if you just want to get rid of the transaction log , you can use one of the options of dump tran (i.e. with truncate only, no_log - see BOL for the appropriate option).

  3. #3
    Join Date
    Sep 2002
    Posts
    53
    one thing i forgot - if your transaction log has become too large (this can happen by leaving the autogrow option on while not backing up the transaction log) you can shrink it.

    look in BOL for 'shrink transaction log' and you will see instructions on how to shrink the transaction log.

    jim

  4. #4
    Join Date
    Sep 2002
    Posts
    19
    Check this article.....Q272318 which uses DBCC ShrinkFile.

  5. #5
    Join Date
    Sep 2002
    Posts
    5,938
    Backup log will truncate commited logs, but not active logs. You can use 'backup transaction db_name with truncate_only' to truncate log without backup file.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •