I have a database which has a 350 MB data file (.mdf) and a 4.9 GB log file (.ldf). The recovery model is set to FULL
.
When I try to shrink the log file, it's not shrinking.
I know shrinking a database is not good and it should not be done. But still i am trying to do it for shrinking the log file.
When I ran
DBCC SQLPerf(logspace)
I found that the log size is 4932 MB and Log space used is 98.76%!
Then I tried this command
USE <databasename>;
DBCC loginfo;
Now almost all VLFs are "status 2" which means all are in use.
I tried to take a log backup and then shrink the log file. Shrinking didn't reduce the size.
I changed the recovery model to SIMPLE
and tried shrinking again, but this also didn't help.
I checked for open transactions
DBCC opentran (database);
and found that no transaction is open now.
What is stopping me from shrinking the log file? How can I solve this?