The transaction log is the part of the database to which the SQL Server writes all transactions before writing them to the database. A transaction can be either one change to the database or a series of related changes that the SQL Server must complete either together or not at all. Except for some non-logged operations, such as a fast bulk copy of data into a table, the log records every transaction. This lets you recreate the sequence of changes to the database should there be a system crash or other problem.
This log keeps your data consistent by guaranteeing that the SQL Server either applies all the changes that are part of the transaction or none of the changes. If the system or disk crashes, the transaction log lets you recover the database to its previous state. You recover the database by restoring your most recent full backup, then applying all changes recorded in the log since that backup.
Truncating the Transaction Log
If log records were never deleted from the transaction log, the logical log would grow until it filled all the available space on the disks holding the physical log files. At some point, old log records no longer necessary for recovering or restoring a database must be deleted to make way for new log records. The process of deleting these log records to reduce the size of the logical log (not physical) is called truncating the log. Truncation of the transaction logs will only occur during execution of the checkpoint statement, which happens nightly during backup of SQL databases (SQL 2005).



11:17 PM
GOUTHAM
0 comments:
Post a Comment