I am new bee for SQL Server dba. I need some suggestion to shrink the database log file.
I have tried and found some solution to shrink the file. But i think this is not opted solution for this.
Solution 1:
ALTER DATABASE nologtest2 SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (nologtest2_log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE nologtest2 SET RECOVERY FULL;
I am not sure I can do this in production.
Solution 2:
Backup log nologtest2 to disk='C:\MAS\nologtest32_log.trn'
DBCC SHRINKFILE (nologtest2_log, 1);
We can took some transaction log backup and then we can shrink the database. But i believe it will break the lsn chain. Then we may face some issue in logshipping environment.
I need some very opted solution for reduce the database log file issues.
Note:
I am not very familiar with being a SQL Server dba. If i am ask anything wrong or understandingly please correct me.
http://dba.stackexchange.com/questions/29829/why-does-the-transaction-log-keep-growing-or-run-out-of-space/48296#48296
– Drew Jan 21 '14 at 20:14