Data | database | Log |mssql| compression
The database in the cumulative operation process, not only its own volume will slowly grow, its log capacity size as well as the database entity file growth and will occupy a lot of space. the size of the MSSQL database contains two sections of data and transaction logs (TransactionLog).
The data part stores the data in the user's database, including the user's data tables, views, stored procedures, and so on.
The data section is typically stored in the. mdb file in the database filegroup. In general, in the case of normal use, this
The size of a section does not change very often, unless it is used to store fast-changing data such as the Forum
Capacity. In general, this section rarely needs to be narrowed.
The transaction log stores transaction records for user database operations, primarily for failure at the database server (more than
such as after a power failure, to restore data integrity in the database. This section is typically stored in a database file
In the. ldf file in the group. The size of this section is often drastically changed.
In some cases, the problem of writing a user's query statement (SQL statement) causes the database file size
The rapid expansion, especially the log files, can become very large. The database needs to be shrunk at this time. Reduced operations
is divided into two steps:
To truncate the contents of a log in a database
BACKUP LOG database name with TRUNCATE_ONLY
Step two force the database to compress its size
DBCC shrinkdatabase (database name, truncateonly)
These two steps need to be performed using Query Analyzer. For its specific meaning, please refer to the database included in the MSSQL
Transact-SQL Help files.
Another way to do this is to set the failover >> model to simple in the database properties >> options of the MSSQL Enterprise Manager, and then determine that the volume of the log file can also be reduced directly.