Compressed database and access compressed Database

Source: Internet
Author: User

Compressed database and access compressed Database
Zookeeper

1. display the disk space reserved and used by the entire database.

EXEC SP_SPACEUSED

2. display the database file list

SELECT * FROM SYSFILES

3. Set the database recovery mode to simple

Alter database DNName set recovery simple with NO_WAIT
GO
Alter database DNName set recovery simple -- SIMPLE mode
GO


Alter database DNName set recovery full with NO_WAIT

GO

Alter database DNName set recovery full -- restore to FULL Mode

GO

4. Compress database files

-- Log

Dbcc shrinkfile (n'dnname _ log', 11, TRUNCATEONLY) -- automatically ignores "percentage of available space required in database files after database contraction ", so "11" can be another value.

Simple Method

Dbcc shrinkfile (0)

Dbcc shrinkfile (1)

0, 1 indicates the database file number, which is queried through sysfiles.

Parameter description:

TRUNCATEONLY: releases all available space at the end of the file to the operating system, but does not move any page inside the file. The data file is only shrunk to the most recently allocated zone. If it is specified with TRUNCATEONLYTarget_percent.

It can increase the compression speed.

However, the compression rate is not high.

5. compress the database

Simple Method

Dbcc shrinkdatabase (0)

Dbcc shrinkdatabase (0, 1, TRUNCATEONLY)

0: indicates the current database.

Add

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.