Hello,
has anyone a script that shrink huges log files in SQL Server 2012 environments?
Thanks a lot in advance.
Luis
Hello,
has anyone a script that shrink huges log files in SQL Server 2012 environments?
Thanks a lot in advance.
Luis
The best way to shrink a log file is to set your database to simple recovery if it is not or use the below command:
ALTER DATABASE databasename SET RECOVERY SIMPLE
DBCC SHRINKFILE (databasename_Log, 1)
NO!!!! You lose your recovery points when you set it to SIMPLE. If there are completed transactions in the log that is preventing a shrink when using bulklogged or full recovery models, you simply just need to backup the transaction log. By doing it this way, you have not broken the transaction log chain.