


Condense log how to#
How to Compress Database in MS SQL Server? Usually, if transaction logs or database backups are created on a regular basis at regular intervals ( with a simple recovery model ), transaction log files do not grow and transaction logs do not overflow.

Condense log full#
It is also possible that the size of transaction log in SQL Server files is too large ( both with a simple and full recovery model ) due to the delay of the truncation procedure, i.e. the size of the journal consists mainly of the active part of the journal, and the active part cannot be truncated, therefore the physical size of the journal increases. The delay of the truncation procedure is influenced by such factors as: active long-running transactions, some scenarios for displaying mirror databases and transaction logs, some scenarios for transactional replication and transaction logs, and truncation of the log is not possible during backup and restore operations. In this case, you need to eliminate the causes of the delay, then do the truncation ( for example, for the full recovery model of the BACKUP log), and then compression to an acceptable size. If you use the full recovery model or the incompletely logged recovery model and your transaction log files are too large, then most likely you have not done a BACKUP ( backup ) transaction log for a long time . In this case, you need to do the BACKUP transaction log first, and then perform the transaction log compression, which we will look at just below. In the full recovery model or in the incompletely logged recovery model – after creating a backup of the log, provided that a checkpoint has been reached since the last backup of the log was created.In a simple recovery model, after reaching a checkpoint, which may occur, for example, after creating a BACKUP database, when the CHECKPOINT statement is explicitly executed, or when the size of the logical transaction log is 70 percent full, in all these cases, the inactive part of the log is automatically cleared i.e. his truncation.Transaction log truncation occurs automatically:

You should distinguish the transaction log compression procedure from the transaction log truncation procedure. Compression is a reduction in the physical size of the log by eliminating unused space, and truncation is freeing up space in the logical log for reuse ( i.e., unused space is created ) by the transaction log while the size of the physical file is not reduced. The greatest effect of compression is achieved when the compression operation is performed after the operation of deleting tables from the database or deleting data from the tables. The physical size of the database files grows with time, this is due to the addition of data, but when they are deleted, the physical size of the files remains the same, but in these files there appears a logical unused space, which can be deleted. What is Compression in SQL Server?Ĭompression is the process of removing unused space in database and transaction log files. hard drive. The way to reduce the physical size of the database file and transaction log in SQL Server is – this is compression .
Condense log free#
Many Microsoft SQL Server administrators have experienced the problem of significantly increasing the physical size of the database and transaction log files and, of course, they would like to somehow reduce this size in order not to take any action related to increasing free space on the server.
