SQL Server 2008 R2下如何清理数据库日志文件
Posted on: 2014-12-16, Last modified: 2015-07-30, View: 1743

SqlServer 2008 R2下测试有效,清理后日志文件为1M

USE [DatabaseName];
GO
ALTER DATABASE [DatabaseName]
SET RECOVERY SIMPLE;--设置简单恢复模式
GO
DBCC SHRINKFILE (logName, 1);
GO
ALTER DATABASE [DatabaseName]
SET RECOVERY FULL;--恢复为原模式
GO 

查询数据库日志文件名称(不一定数据库文件名称就和数据库名称一样)

USE [DatabaseName]   
GO  
SELECT name FROM SYS.database_files WHERE type_desc='LOG'

 

From: http://www.hackbase.com/tech/2013-10-24/68364.html
Go
Related Articles:
No records!
Friend Links:
Bill Site
https://item.taobao.com/item.htm?spm=a21an.7676007.1998473182.296.lAvrE2&id=45399580446