清理SQLServer数据库日志

手动清理:
D:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Log
 

语句清理:
ALTER DATABASE  数据库   SET RECOVERY SIMPLE
ALTER DATABASE  数据库  SET RECOVERY FULL
DBCC SHRINKDATABASE ( 数据库 , 0 )


Tempdb事务日志满了之后,可以在没有回话占用tempdb的时候,使用下面的语句收缩日志

   use tempdb
   go

   dbcc shrinkfile (tempdev, 'target size in MB')
   go
   -- this command shrinks the primary data file

   dbcc shrinkfile (templog, 'target size in MB')
   go
   -- this command shrinks the log file, look at the last paragraph.

你可能感兴趣的:(SQL)