Sql statement to the database to lose weight, the following is a Web fox 6603 database weight loss script
Web fox 6603 special database weight loss special effect script (18G becomes 300m) is as follows:
Copy the script statement to the new sql server query and execute it. You can clear the redundant logs.
/ *
* database super weight loss, 18G can be changed into 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. Shrink log file size (in 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-- find the logical name of the database log file
More knowledge points can be seen in × × × www.yasewl.com