Huge Transaction log

  • Our database exists more then 2 years. Now .mdf file is 264 mb and .ldf file 204 mb and is steadily growing. How can I make it small again?

  • Perform a transaction log backup and then shrink the file. In BOL, see BACKUP LOG and DBCC SHRINKFILE. Scheduled tran log backups should keep the size under control thereafter.

    --Jonathan



    --Jonathan

  • Thank You

  • dbcc shrinkdb also can help u. Check BOL

  • Another way is to detach the database, rename or remove the log file and attach again.

    When attaching the database, SQL will prompt you to create a new log file.

    In this way, your trans log will be only few kb.

    Important: Must backup your trans log before doing this

  • Are you taking log backups? If not then you should set the recovery model to simple for the database.

    I would also recommend changing the recovery model for the model database to simple so that new databases are automatically created with this option.

    Cursors never.

    DTS - only when needed and never to control.


    Cursors never.
    DTS - only when needed and never to control.

  • I'm very grateful to all who answered

  • Exercise care with the database recovery option. Its best to leave this to "Full" for all databases and make regular backups. Change to "Simple" or "bulk Logged" only as necessary for large data loads that can be repeated if necessary.


    -Isaiah

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

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