SQLTeam.com | Weblogs | Forums

Not shrinking log file

Hello,

I am trying to shrink my production log file as its occupying lot of space in L drive. Its in Alwayson setup. two days back i already removed the db from alwayon and made it simple recovery mode and shrinked the log file. Now again the logs were growing. I checked any open transactions. No open transactions. I checked the log_reuse_wait_desc. Its showing aVAILABILITY_REPLICA.

i tried below commands also.

USE[abc]
GO
CHECKPOINT
GO
CHECKPOINT

DBCC SHRINKFILE('abc_log', 1024, TRUNCATEONLY)
go

Took t-log backups also.tried shrinking log files. Nothing helping me to reduce the size. Infact after running the above commands the log space increased surprisingly. .
I can not remove this db from alwayson and make simple ,shrink. Please help me to reduce the log space..:frowning:

Thanks,

sometimes you need to backup the log multiple times and run the shrink file multiple times to see the effect.
Note that, using TRUNCATEONLY will break your log backup sequence.

Yes i took couple of times t-log backups and shrinking. Surprisingly its keep on increasing the log space..:

Verify the send and redo queues are caught up on the replica. The log space cannot be marked as reusable until the transactions have been committed on the replica.

adding to @jeffw8713, the log_reuse_wait_desc value should be NOTHING.