1#

sql server 日志文件过大,已经400G。将数据库恢复模式设置为“简单”,再收缩文件-日志,发现无效。

上网搜索,可能是是因为数据库搭建了复制或者是曾经搭建了复制,没有清除干净。

先执行  SELECT name,log_reuse_wait_desc FROM sys.databases where name='dbname'

正常时log_reuse_wait_desc列应该是NOTHING,如果是REPLICATION,则表示搭建了事务复制,需执行

exec sp_removedbreplication 'database' 清除复制状态,再收缩文件,问题解决