Understanding and Controlling Transaction Logs



Similar documents
SQL Server Transaction Log from A to Z

Database Maintenance Essentials

Transaction Log Internals and Troubleshooting. Andrey Zavadskiy

Handling a Full SQL Server Transaction Log

Optimizing SQL Server 2012 for SharePoint SharePoint Saturday/Friday, Honolulu March 27, 2015

Bulletproof your Database Backup and Recovery Strategy

DBA 101: Best Practices All DBAs Should Follow

sql server best practice

Administering Microsoft SQL Server Databases

Administering Microsoft SQL Server Databases

Administering Microsoft SQL Server 2012 Databases

Best Practices Every SQL Server DBA Must Know

General DBA Best Practices

Course Outline:

Managing Relativity SQL log files

ADMINISTERING MICROSOFT SQL SERVER DATABASES

Administering Microsoft SQL Server Databases

Administering Microsoft SQL Server 2012 Databases

6231B: Maintaining a Microsoft SQL Server 2008 R2 Database

Administering Microsoft SQL Server Databases

Administering Microsoft SQL Server Databases 20462C; 5 days

Course: Administering Microsoft SQL Server Databases Overview

MOC 20462C: Administering Microsoft SQL Server Databases

20462C: Administering Microsoft SQL Server Databases

Administering Microsoft SQL Server Databases

Course 20462C: Administering Microsoft SQL Server Databases

20462 Administering Microsoft SQL Server Databases

MS-10775: Administering Microsoft SQL Server 2012 Databases. Course Objectives. Required Exam(s) Price. Duration. Methods of Delivery.

Administering Microsoft SQL Server 2012 Databases

Administering Microsoft SQL Server Databases

Administering Microsoft SQL Server 2014 Databases

ExecuTrain Course Outline MOC 6231B: Maintaining a Microsoft SQL Server 2008 R2 Database

Restoring Microsoft SQL Server 7 Master Databases

Exam : Transition Your MCTS on SQL Server 2008 to MCSA: SQL Server 2012, Part 2. Title : The safer, easier way to help you pass any IT exams.

10775 Administering Microsoft SQL Server Databases

tairways handbook SQL Server Transaction Log Management

Before attending this course, participants should have:

Below are the some of the new features of SQL Server that has been discussed in this course

10775A Administering Microsoft SQL Server 2012 Databases

Course 6231B: Maintaining a Microsoft SQL Server 2008 R2 Database

MS Administering Microsoft SQL Server Databases

SQL Tips and Tricks for Dynamics GP. Lisa Williams and Darrell Moy

Administering Microsoft SQL Server Databases

Administering Microsoft SQL Server Databases

Administering Microsoft SQL Server Databases MOC 20462

SYSTEM SETUP FOR SPE PLATFORMS

SQL Server 2014

6231B: Maintaining a Microsoft SQL Server 2008 R2 Database

Administering Microsoft SQL Server Databases

Administrating Microsoft SQL Server 2012 Databases

AuditWizard v8. SQL Maintenance

Microsoft Administering Microsoft SQL Server Databases

Jason S Wong Sr. DBA IT Applications Manager DBA Developer Programmer M.S. Rice 88, MBA U.H. 94(MIS)

SPR201 The Foundations of a Healthy SQL Server Database Links and Hidden Slides

David Dye. Extract, Transform, Load

Tuning Microsoft SQL Server for SharePoint. Daniel Glenn

Maintaining a Microsoft SQL Server 2008 R2 Database

ITMT 1074 Course Syllabus

ESSENTIAL SKILLS FOR SQL SERVER DBAS

MOC Administering Microsoft SQL Server 2014 Databases

SQL Database Administration. Overview

Managing Relativity SQL log files

Administering Microsoft SQL Server Databases

PCSchool SQL Backup Tech Tip. SQL Backup Tech Tip. Created in version /9

Microsoft Official Courseware

The Database is Slow

Administering Microsoft SQL Server Databases

W I S E. SQL Server 2008/2008 R2 Advanced DBA Performance & WISE LTD.

Course 20462: Administering Microsoft SQL Server Databases

Destiny system backups white paper

SQL Best Practices for SharePoint admins, the reluctant DBA. ITP324 Todd Klindt

Microsoft SQL Server 2014: MS SQL Server Administering Databases

Microsoft Maintaining a Microsoft SQL Server 2008 Database

Administering Microsoft SQL Server 2012 Databases

Body Part No. X

Best practices for operational excellence (SharePoint Server 2010)

Explain how to prepare the hardware and other resources necessary to install SQL Server. Install SQL Server. Manage and configure SQL Server.

SQL Server 2008 Administration

SQL SERVER Anti-Forensics. Cesar Cerrudo

$99.95 per user. SQL Server 2005 Database Administration CourseId: 152 Skill level: Run Time: 30+ hours (158 videos)

402: Taming SQL Server for Administrators. Todd Klindt & Shane Young SharePoint911

SQL Server Instance-Level Benchmarks with HammerDB

CA ARCserve and CA XOsoft r12.5 Best Practices for protecting Microsoft SQL Server

Getting to Know the SQL Server Management Studio

Keystone Enterprise Backup

Maintaining a Microsoft SQL Server 2008 Database

SQL Server Encryption Overview. September 2, 2015

SharePoint for the DBA. Régis Baccaro

Back From the Dead: How to Restore a SQL Server in 60 Minutes or Less*

Massive Data Storage

Microsoft SQL Database Administrator Certification

Version: Page 1 of 5

MS SQL Server Backup - User Guide

SQL Server for Database Administrators Course Syllabus

Module 07. Log Shipping

SQL Server 2008 Designing, Optimizing, and Maintaining a Database Session 1

Mind Q Systems Private Limited

AccuGuard Enterprise for RDX

Advanced SQL Server backup & recovery for VM environments

Transcription:

Understanding and Controlling Transaction Logs Nigel Peter Sammy #sqlinthecity

http://www.nigelpsammy.com

#sqlinthecity Managing Expectations This is a 100-300 level session. This session does not cover Tempdb Transaction Log.

#sqlinthecity Agenda Relational DBMS Basics Introduction to Transaction Logs The Architecture Recovery Models Managing the Transaction Logs Red Gate Tools

RELATIONAL DBMS BASICS

Transaction #sqlinthecity Transaction is an action or series of actions carried out by a single user or application that reads and/or updates the contents of a database.

Properties of a Transaction #sqlinthecity Atomicity Consistency Isolation Durability Either all the operations constituting transaction are performed or non them Guarantees that the database evolves from one consistent state to another. Concurrent transactions behave as though each were the only transaction running in the system Committed transactions are guaranteed to be physically performed

INTRODUCTION TO TRANSACTION LOGS

#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.

Purpose of Transaction Logs #sqlinthecity Recovery of individual transactions Recovery of all incomplete transaction Restore to the point of failure Supporting replication and various standby server solutions

How the Transaction Log works #sqlinthecity

THE ARCHITECTURE

Virtual Log Files #sqlinthecity VLF 1 VLF 2 VLF 3 VLF 4 USED UNUSED UNUSED UNUSED Number of VLFs <64 MB = 4 VLFs 64 MB 1 GB = 8 VLFs >1GB = 16 VLFs Size of VLFs <64 MB = approx. 1/4 size or growth size 64 MB 1 GB = approx. 1/8 size or growth size >1GB = approx. 1/16 size or growth size

Virtual Log Files #sqlinthecity VLF 1 VLF 2 VLF 3 VLF 4 USED UNUSED UNUSED UNUSED Transaction 1 Transaction 2 Transaction 3

Virtual Log Files #sqlinthecity VLF 1 VLF 2 VLF 3 VLF 4 USED UNUSED UNUSED UNUSED Transaction 1 Transaction 2 Transaction 3

Circular Nature of Logs #sqlinthecity VLF 1 VLF 2 VLF 3 VLF 4 USED USED USED UNUSED VLF 1 VLF 2 VLF 3 VLF 4 TRUNCATED USED UNUSED VLF 5 VLF 2 VLF 3 VLF 4 USED TRUNCATED USED USED

#sqlinthecity Transaction logs backup These backups are important for: Enabling point-in-time restore of your database Controlling the size of the log file

Recovery Models #sqlinthecity Simple Bulk Logged Full

MANAGING THE TRANSACTION LOGS

Transaction Logs Management #sqlinthecity 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

DBCC #sqlinthecity DBCC SQLPERF(logspace) DBCC SHRINKFILE DBCC LOGINFO DBCC OPENTRAN

Transaction Logs Issues #sqlinthecity Excessive File Growth Full Transaction Log (SQL Server Error 9002) VLF Fragmentation No Log File

Transaction Logs Solutions #sqlinthecity 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

#sqlinthecity Demo DBCC Commands and DMVs

RED GATE TOOLS

#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

#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.

QUESTIONS

#sqlinthecity Extra Resources Blogs and Articles Paul Randall Kimberly L. Tripp Brad McGehee Gail Shaw SQL Server Central

#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