How to shrink large LDF I have a client with a SQL2016 DB with a 100Gb MDF and a 4Gb LDF. The DB is set to Simple.
I can't get it done to shrink the LDF to a minimum. How can I shrink the LDF to a normal level?
Does this setup and file sizes effects performance?
Before attempting to shrink the logfile, you need to understand if it's a problem or not. It probably isn't.
The log is that size most likely because it needed to grow to that size, meaning that if you shrink it, it will likely grow back to that size in the future - and that log growth will momentarily slow whatever transaction is causing it to grow.
With it only being 4GB and in SIMPLE recovery, I would recommend simply leaving the log as it is, and perhaps adjust the auto growth to fixed 1GB chunks.
If you simply must shrink the log, you can do so with DBCC SHRINKFILE, using the TRUNCATEONLY option. Example:
DBCC SHRINKFILE (Database_log_file_name, 1);
This will truncate the file all the way down to the last open transaction which, if the database is idle or mostly idle, will be the whole thing. But first make sure you've set your auto-growth as described above, and you might even want to re-size the log to what you think you need.
But again...4GB on a 100GB database is not a big deal. I'd just let it stay there.