How do I decrease the size of my sql server log file?

前端 未结 6 872
梦谈多话
梦谈多话 2020-12-04 13:08

So I have been neglecting to do any backups of my fogbugz database, and now the fogbugz ldf file is over 2 and half gigs. Thats been built up over the six months we\'ve been

6条回答
  •  甜味超标
    2020-12-04 13:54

    Welcome to the fickle world of SQL Server log management.

    SOMETHING is wrong, though I don't think anyone will be able to tell you more than that without some additional information. For example, has this database ever been used for Transactional SQL Server replication? This can cause issues like this if a transaction hasn't been replicated to a subscriber.

    In the interim, this should at least allow you to kill the log file:

    1. Perform a full backup of your database. Don't skip this. Really.
    2. Change the backup method of your database to "Simple"
    3. Open a query window and enter "checkpoint" and execute
    4. Perform another backup of the database
    5. Change the backup method of your database back to "Full" (or whatever it was, if it wasn't already Simple)
    6. Perform a final full backup of the database.

    You should now be able to shrink the files (if performing the backup didn't do that for you).

    Good luck!

提交回复
热议问题