SQL Shrink Database

Source: Internet
Author: User
Database shrinkage:
Personal understanding, the database in the process of ordinary long-term operation of the log files will always be in a certain proportion in the increase, data files in the database after deleting a large amount of data does not necessarily reduce disk space, repeated operations will appear wasted space, so the shrinking database will be reflected.
Suppose the database is set to shrink the database at a time, or a job or something, so it does not have to manually shrink, but the timing of things you know, will be kept waiting for an incident point to do this thing, from the perspective of system resources or manual contraction manually.

See Data file 2.07GB

Log 11.1GB

Well, first, we'll teach you a general shrinkage method.

Move the page to the starting position of the file before shrinking (front hook)

And I'll show you the size of the database.

It shrinks a lot and becomes 5.93GB. The constant value after repeated operation indicates that it is the minimum value.
However, the database log file was found to be not smaller.
First separation database
Second Delete log file
Third additional database

Click Yes, a database log file will be regenerated about 500kb in appearance

SQL Shrink Database

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.