I have a database .mdf
file that is 138 GB along with a transaction log file of 55 GB.
The recovery model was set to Full (which it doesn't need to be). I ran a full backup of the database and the transaction log. The transaction log is still 55 GB with no free space to shrink the file.
I ran that backup through SQL Server Management Studio GUI. I then ran the following commands to try to force the trans log to shrink:
BACKUP LOG database WITH TRUNCATE_ONLY
DBCC SHRINKFILE (logfile, TRUNCATEONLY )
The log file is still 55 GB. I then changed the recovery model to Simple
and let it sit a few days, but it's still at 55 GB. I tried those 2 commands above again but it still doesn't truncate anything.
No matter what I try, this log file won't shrink. Since we don't need the transaction log at all, I even tried detaching the database, renaming the log file and reattaching. That doesn't work either as there are actually 2 transaction logs, and I get an error when trying to reattach without the logs. The other log file is only 1 MB, and I've tried to remove that as well, but get also get an error saying it's not empty.
Is there something I'm missing, or something else I can try?
Thanks for any help!