Why do I have to backup a transaction log twice for it to shrink?
Posted on 2012-03-26
This is kind of a two part question. I have a SQL database that I have to keep running only until the product is replaced. The transaction log for the database constantly jumps to 2GB or more and I have to manually shrink it. When I manually shrink I alwasy have to...
1. back up the DB
2. run the shrink
3 back up the DB again
4. run the shrink
For whatever reason - I have to backup/shrink twice for the shrink to work and I think I actually found that work around here on EE. Why is this the case and how can I get a DBCC shrinkt to work on the first shot.
The reason I need to know this is that I need to automate this shrink process and the maintenance plans never really shrink the DB. Which leads to my next question - can anyone point me to a good query that will shrink the DB after a backup?