How To Clear The Transaction Log

Table of contents:

How To Clear The Transaction Log
How To Clear The Transaction Log

Video: How To Clear The Transaction Log

Video: How To Clear The Transaction Log
Video: How to Clear log file in SQL Server 2024, November
Anonim

The task of clearing the 1C transaction log based on Microsoft SQL Server presents certain difficulties due to the function of automatically increasing the size of its own files, despite the existing possibility of automatically decreasing the selected file.

How to clear the transaction log
How to clear the transaction log

Instructions

Step 1

Make sure that you understand the scheme of the selected cleanup operation, or rather, truncation of the transaction log: the procedure can only be carried out by truncating free space at the end of the file and is directly related to the chosen method of creating a backup. If the Full option is selected, it is required to complete all saved transactions and create a backup in the Remove inactive entries from transactional log mode. Selecting the Simple option truncates the entire file, but does not necessarily imply transaction recovery.

Step 2

The transaction log file can be truncated using the Query Analyzer tool with the DBCC Shrinkfile command (logfile_name, desired_file_size), and the cleanup operation can only be performed after creating a full standby with the same command. Use the following syntax to define copy options: BackUp Log selected_dbname with truncate only.

Step 3

Create a full backup of the transaction log file to be cleaned if you do not want to restore the data using the Backup Database tool and clear the Remove inactive entries from transactional log check box. Go to the Options tab and change the Recovery Model parameter to Simple. Truncate the selected file with the command above, or use the syntax DBCC ShrinkDatabase (selected_db_name, required_size_residual_file_in_%).

Step 4

Check the box next to Remove inactive entries from transactional log and back up the original set from Enterprise Manager. Restore the Recovery Model to Full and re-restore the log from Enterprise Manager over the existing copy. Uncheck the Remove inactive entries from transactional log checkbox again and once again back up the selected transaction log.

Recommended: