1.启动sql server企业管理器
2.登录数据库管理系统
3.点击新建查询按钮
4.输入清理日志语句,点击 执行 按钮,执行创建清理日志存储过程操作
语句如下
set ANSI_NULLS ON
set QUOTED_IDENTIFIER ON
go
CREATE PROCEDURE [dbo].[clearlog]
AS
SET NOCOUNT ON
ALTER DATABASE toppms SET RECOVERY SIMPLE WITH NO_WAIT
ALTER DATABASE toppms SET RECOVERY SIMPLE --简单模式
DBCC SHRINKFILE (N'toppms_Log' , 1, TRUNCATEONLY)
ALTER DATABASE toppms SET RECOVERY FULL WITH NO_WAIT
ALTER DATABASE toppms SET RECOVERY FULL --还原为完全模式