网狐6603 专用数据库减肥特效脚本(18G变成300M)如下:
将脚本语句复制到sql server 新建查询中,执行即可,可以清楚冗余的日志
/*
* 数据库超级减肥, 18G可变成300M.
*/
-- Truncate the log by changing the database recovery model to SIMPLE.
use qptreasuredb
ALTER DATABASE qptreasuredb
SET RECOVERY SIMPLE
GO
-- Shrink the truncated log file to 1 MB. 收缩日志文件大小(单位是M)
DBCC SHRINKFILE (qptreasuredb_log, 1)
GO
-- Reset the database recovery model.
ALTER DATABASE qptreasuredb
SET RECOVERY FULL
use qprecorddb
ALTER DATABASE qprecorddb
SET RECOVERY SIMPLE
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (qprecorddb_log, 1)
GO
-- Reset the database recovery model.
ALTER DATABASE qprecorddb
SET RECOVERY FULL
use qpaccountsdb
ALTER DATABASE qpaccountsdb
SET RECOVERY SIMPLE
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (qpaccountsdb_log, 1)
GO
-- Reset the database recovery model.
ALTER DATABASE qpaccountsdb
SET RECOVERY FULL
GO
use QPEducateDB
ALTER DATABASE QPEducateDB
SET RECOVERY SIMPLE
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (QPEducateDB_log, 1)
GO
-- Reset the database recovery model.
ALTER DATABASE QPEducateDB
SET RECOVERY FULL
go
select * from sys.database_files --查找数据库log文件逻辑名
更多知识点可见×××××× www.yasewl.com
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。