Database reduction

I was instructed to compress the SQL Server 2005 database. This is an information database and is about 35 GB.

  • How to compress a database?
  • Can this be done while this database is live?
  • How big is this database when it will be shortened?

Thanks in advance.

+3
source share
2 answers

First, if you can avoid shrinking the production database, do it. Purchasing additional disk storage is almost always a more practical solution in the long run.

, / , , ( ), , .

, .

, , , , , . -, .

, . , , , , .

, DBCC SHRINKFILE.

:

:

EXEC sp_spaceused

:

DBCC SQLPERF('logspace')

/:

SELECT 
    name AS 'File Name' , 
    physical_name AS 'Physical Name', 
    size/128 AS 'Total Size in MB',
    size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 AS 'Available Space In MB',
    *
FROM sys.database_files;
+7
  • SQL Server Management Studio. → → →

  • . .

  • . , 35Gb. 35Gb ( ), .

+4

Source: https://habr.com/ru/post/1750289/


All Articles