如果SQL SERVER 日志过大,比如,达到了几十个G,想一次性收缩的,直接执行下面命令即可: USE DATABASENAME; GO – Truncate the log by changing the database recovery model to SIMPLE. ALTER DATABASE DATABASENAME SET RECOVERY SIMPLE; GO – Shrink the truncated log file to 1 MB. DBCC SHRINKFILE (…
SQL2008 的收缩日志 由于SQL2008对文件和日志管理进行了优化,所以以下语句在SQL2005中可以运行但在SQL2008中已经被取消: (SQL2005) BackupLog DNName with no_log go dump transaction DNName with no_log go USE DNName ) Go -------------------------------------------------------------- (SQL2008): 在SQL20…