博客园 首页 联系 管理

GO

--在查询结果中获得日志文件名

select * from sysfiles

--DB日志
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 ( [LOGFileName] , 1);
GO
-- Reset the database recovery model.
ALTER DATABASE [DataBaseName]
SET RECOVERY FULL;

posted on 2011-01-11 12:02  CodeBlove  阅读(317)  评论(0编辑  收藏  举报