Friday 27 February 2015

SQL Server Transaction Log

Thinking of a database management system, a mission critical application and a breakthrough perform, the first application which strikes the mind of the user is SQL Server. SQL Server is best rated database management application which provide storage and management of database. SQL support three different file formats, MDF for primary database NDF for secondary database and LDF for the transaction logs or can say for log database. At the time when your database gets corrupted you can recover your full data by using the transaction log saved as .ldf format.

Note: - But sometimes this backup is not maintained so then at the time of corruption other methods are used to repair corrupt data.



Transactions Log: - Basically transaction log contain all the records of the transaction operations done on your database. Truncation should be done on transaction log to reduce the size of these files.
Supported Operations by Transaction:-  All the operations supported by transaction log are listed below.

  •   Individual transaction recovery.
  • Transaction replication support.
  •  It recovers all pending transactions when SQL Server is started.
  • Database mirroring, log shipping and Always on groups are some recovery and               high availability solutions.

Truncation in Transaction log: - Truncation done in transaction log will free the space in the log files. In this process the in-active virtual log files are deleted so to avoid transaction log filling. So truncation of transaction log is an important process to avoid the filling of full disk space allocated to transaction log. The delay in this process can cause problem so there is automatic start of this process by certain events that are listed below.


  •  When check-point occurs in the simple recovery model than truncation occurs.
  • In the case of full and bulked-logged recovery model when log back-up occurs the truncation of transaction log take place.

As mentioned above truncation take place when virtual log are inactive but sometimes the long activeness of the logs leads to deal in this truncation process. But sometimes we need to analysis the transaction files so for that can use Log Analyzer Tool.




No comments:

Post a Comment

Note: only a member of this blog may post a comment.