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)
-- 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.
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數據庫減肥腳本