March 16, 2020 at 11:26 am
Hi guys
this is just a test database, so no urgency
I have a database that has about 8Mb (yes a tiny database) but the log was allowed to grow to 74GB (with 99% free space) - there are no open transactions , it got restored to our new 2019 server and put into an availability group
so, I've run a checkpoint on the database, a dbcc opentran() and then a shrinkfile on the log . the log won't shrink
normally I can fix this by swapping to simple recovery model and then fixing it, - put it back into full and start a backup (the backup is just for DR)
But being in an AG I cannot change the recovery mode.
any hints as to how to get that stupid log to shrink are more than welcome
MVDBA
March 16, 2020 at 12:46 pm
Whats the status of log_wait_reuse_desc in sys.databases?
May be a case that you need to run a few log backups to get it to be able to checkpoint and shrink.
March 16, 2020 at 12:47 pm
Mike, what is log_reuse_wait_desc for this database in sys.databases?
select name, log_reuse_wait_desc from sys.databases where name=N'yoursmalldb'
March 16, 2020 at 1:46 pm
fixed it perfectly
thank you.
even though the database had come from a full backup it did not want to shrink until it had a t log backup of an empty log file.
good shout on that one
MVDBA
Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy