sql语句给数据库减肥,下面以网狐6603数据库减肥脚本
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了sql语句给数据库减肥,下面以网狐6603数据库减肥脚本相关的知识,希望对你有一定的参考价值。
网狐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
本文出自 “棋牌源码搭建教程” 博客,请务必保留此出处http://13152879.blog.51cto.com/13142879/1949781
以上是关于sql语句给数据库减肥,下面以网狐6603数据库减肥脚本的主要内容,如果未能解决你的问题,请参考以下文章