SQL In The City - Understanding and Controlling Transaction Logs by Nigel Peter Sammy.
- Relational DBMS Basics
- Introduction to Transaction Logs
- The Architecture
- Recovery Models
- Managing the Transaction Logs
- Red Gate Tools
7. #sqlinthecity
Properties of a Transaction
Atomicity
Either all the operations constituting transaction
are performed or non them
Consistency
Guarantees that the database evolves from one
consistent state to another.
Isolation
Concurrent transactions behave as though each
were the only transaction running in the system
Durability
Committed transactions are guaranteed to be
physically performed
9. #sqlinthecity
The Transaction Log
The transaction log is a serial record of all the
transactions and the modifications that occurred in
a database.
Each SQL Server database has at least one
transaction log file and generally has the .ldf
extension.
10. #sqlinthecity
Purpose of Transaction Logs
Recovery of individual transactions
Recovery of all incomplete transaction
Restore to the point of failure
Supporting replication and various standby server
solutions
20. #sqlinthecity
Transaction Logs Management
Create one log file on a separate disk
Create a reasonably sized transaction log
Auto-growth is good but …
Perform Transaction Log backups
Monitor, Monitor and of course Monitor
23. #sqlinthecity
Transaction Logs Solutions
• Excessive File Growth
– Truncate the log (log_reuse_wait_desc from sys.database)
• Full Transaction Log
– Depends on if your disk is full or auto-growth was not enabled
• VLF Fragmentation
– Modify the log file size after truncating and shrinking it
• No Log File
– Restore from backup files
– Log rebuild and repair
26. #sqlinthecity
SQL Monitor
Red Gate’s Performance monitoring and alerting tool
• Allows users to monitor log file
• Allows user to monitor disk space
• Allows users to find long running transactions
27. #sqlinthecity
SQL Backup Pro
• Improves the performance of your backups and restores
considerably.
• Allows users to easily restore a transaction log to a point in
time.
30. #sqlinthecity
Thank you for attending, please complete the online
feedback form
www.red-gate.com/sitc13-feedback
In return you can:
- Collect a Red Gate book of your
choice from 5PM
- Have a chance to win a
Conference pass to SQL Server
LIVE! 2013, which will be drawn at
5.15PM