SQL shrinks database
Database shrinkage:
Personal understanding, in the process of ordinary long-term operation of the database, the log files of the data will always increase by a certain proportion, and the data files will not necessarily reduce the disk space after deleting a large amount of data in the database, and repeated operations will lead to a waste of space, so shrinking the database will be reflected.
Suppose you set the database to shrink the database regularly, or do an assignment or something, so that you don't have to shrink manually, but you know, you will keep waiting for an event point to do it, or manually shrink from the point of view of system resources.
See the data file 2.07gb
Log 11.1gb
Well, let's first teach you the general method of contraction.
Move the page to the beginning of the file before shrinking (tick in front)
Then show you the size of the database.
It shrank a lot and became 5.93gb. The constant value after repeated operation means that it is already the minimum value.
But it is found that the database log file has not become smaller.
The first separate database
Second, delete log files
The third additional database
Click Yes, a database log file will be regenerated about what 500kb looks like