The company has to standardize the size of the personnel library every month.
The following is a SQL Server with the size of the SQL repository:
SELECT db_name(database_id) as [Database Name], [Name] as [Logical Name], ((Size* 8)/ 1024x768) as [Size (MB)],--the original unit of size is bit, so multiply 8 to byte and multiply by 1024 to MByte. [Differential_base_time] as [differential Base time] fromsys.master_filesWHERE db_name(database_id)inch('SMOOTHHR','Hrreport','Smoothexchage');--' smoothhr ', ' hrreport ', ' smoothexchage ' are divided by the name of the repository.
Results:
You can see that the smoothhr_log is larger and can be compressed.
The compression log file needs to be in a simple mode, so you can take a look at the library's journal-ready mode:
SELECT from WHERE inch ('smoothhr','hrreport','smoothexchage ');
You can see all the "full" mode, so turn it into a simple mode, then log compression, and then restore the full-copy mode:
UseSMOOTHHRGOALTER DATABASESmoothhrSETRECOVERY Simple--if it is full (fully provisioned) mode, set the simple recovery modeGODBCCShrinkfile (Smoothhr_log,Ten)--compressing log files to 10MGOALTER DATABASESmoothhrSETRECOVERY Full--back to the original full (fully prepared) mode after completionGO
See the following results, said success!
At this time, the size of the DB, the log file is successfully compressed:
MS SQL Server View repository size and compression log file