sql server2012收缩日志


--先执行完整备份
backup database db to disk='E:\backup\db.bak' WITH init;
--再执行日志备份(默认追加)
backup log db to disk='E:\backup\db.bak' 
--修改数据库恢复模式 
ALTER DATABASE db SET RECOVERY SIMPLE 
--收缩日志至10MB 
DBCC SHRINKFILE (db_Log, 10);
--修改数据库恢复模式 
ALTER DATABASE DB SET RECOVERY FULL;

Whatever is worth doing is worth doing well.