31

Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Embed Size (px)

Citation preview

Page 1: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary
Page 2: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Tips and Tricks for Successful Database Mirroring Deployments with Microsoft SQL Server Paul Filmalter

PFEMicrosoftDAT313

Page 3: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Agenda

Setting the SceneWhat’s New In Database Mirroring in SQL Server 2008Tips and TricksSummary

Page 4: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Setting the Scene

Witness

Principle Mirror

Page 5: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Setting it updemo

Page 6: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Agenda

Setting the SceneWhat’s New In Database Mirroring in SQL Server 2008Tips and TricksSummary

Page 7: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Improvements in 2008Log Stream Compression

Works with both async and syncGood network, local = minimal/no improvementWill see more improvements with “bad” networks, distanceReduces send queueFunction of the transactions, not the networkTradeoff: CPU hit on principal and mirrorOn by default (Trace Flag 1462 to turn off)

Page 8: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Log Stream CompressionLog Stream Compression

MeasuringDatabase Mirroring: Log Bytes Sent/sec (uncompressed)Database Mirroring: Log Compressed Bytes Sent/secDatabases: Transactions/secSQL Statistics: Batch Requests/secProcessor: % Processor

Page 9: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Log stream compressiondemo

Page 10: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Improvements in 2008Data Page Corruption Recovery

823, 824, 829 error encounteredSQL Server will read partnerGood copy of page will replace bad copy

Page 11: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Recovery from corruption with database mirroring

demo

Page 12: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Improvements in 2008Backup Compression

Enterprise Edition only, but can restore compressed backups on all editionsReduces initialization time

File sizes smallerQuicker copy time

Watch the CPU

Page 13: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Agenda

Setting the SceneWhat’s New In Database Mirroring in SQL Server 2008Tips and TricksSummary

Page 14: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Number of Databases …

10 DBs is a recommendation, not a limitationCustomers ARE doing more than that

Will depend on workloadsI/OThreadsCPUMemory

More headroom with 64-bit

Page 15: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Failover Clustering and Database Mirroring

Compliment each otherInstance vs. database protectionAge old question: asynchronous or synchronous?Considerations

Most want clustering to be the primary HA feature Challenge: database mirroring failover is generally faster than a cluster failover (Timeout)

Page 16: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Using a Mirror for Reporting

Done via snapshotsMust be refreshed

Can make the mirror more useful – not just a standbyDownside: licensingGeneral tip: watch I/O use – do not want to impact the mirror if your main goal is availability

Page 17: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Creating snapshots with database mirroring

demo

Page 18: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Using DBM to Upgrade 2005->2008

Minimal downtimeUnconfigure WitnessMust be synchronous (no automatic failover)Use SQL Server 2005 SP2 CU5 (or later)

Page 19: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Upgrading from SQL Server 2005 to 2008 using database mirroring

demo

Page 20: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Gotchas/Tips/Tricks 1

ApplicationWatch transaction sizeFailover Partner in connection string

Make sure you have good networksUse aliases in connection string if using failover partnerRestoring the principal database

Cannot happen while in a mirroring session either from a backup or a snapshot

Page 21: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Gotchas/Tips/Tricks 2

Initial configurationPossibly configure log shipping, then convert to DBM

Transactional replication stops if DBM pausedPrevents Subscriber from getting ahead of mirrorTrace flag 1448 (2008) – overrides behavior2005 – KB937041 (hotfix for SP2, then TF)

T-log growth and backup affected

Page 22: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Gotchas/Tips/Tricks 3

Disk configurationNeed good I/O performance; can be a bottleneckI/O on mirror may be higher than principal (by design)

Trace Flag 3499 to alter I/O behavior (DO NOT USE UNLESS TEST THOROUGHLY) – will delay failover

Logged operations and maintenance – effect on principal’s log

Page 23: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Agenda

Setting the SceneWhat’s New In Database Mirroring in SQL Server 2008Tips and TricksSummary

Page 24: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Summary

Database mirroring can improve a database’s availability with minimal to no loss of dataDatabase mirroring has improved with SQL Server 2008

Log stream compression can be helpfulDo proper monitoringNeed good configurations and hardware (esp. network and disk)

Page 25: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

question & answer

Page 26: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

South African SQL Server Usergroup

Meet monthly, 3rd Tuesday evening at Microsoft’s Offices in BryanstonCurrent leads: Paul Filmalter and Gail Shaw

Page 27: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

www.microsoft.com/teched

International Content & Community

http://microsoft.com/technet

Resources for IT Professionals

http://microsoft.com/msdn

Resources for Developers

www.microsoft.com/learning

Microsoft Certification & Training Resources

Resources Tech·Ed Africa 2009 sessions will be made available for download the week after the event from: www.tech-ed.co.za

Page 28: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Additional Resources

External ResourcesSQL Server Customer Advisory Team blog2005 Database Mirroring Best Practices and Performance Considerations whitepaperConfiguring Database Mirroring with SQL Server 2008 PowerShellConfiguring SharePoint and Database Mirroring whitepaperDatabase Mirroring and Log shipping Working Together whitepaperImplementing Application Failover with Database Mirroring whitepaperSQL Server Replication: Providing High Availability using Database Mirroring whitepaper

SQL Server 2008 Business Value Calculator: www.moresqlserver.com

Page 29: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

SQL Server Community Resources

Become a FREE PASS Member: www.sqlpass.org/RegisterforSQLPASS.aspxLearn more about the PASS organization www.sqlpass.org/

Additional Community ResourcesSQL Server Community Center www.microsoft.com/sqlserver/2008/en/us/community-center.aspxTechNet Community for IT Professionalshttp://technet.microsoft.com/en-us/sqlserver/bb671048.aspxDeveloper Center http://msdn.microsoft.com/en-us/sqlserver/bb671064.aspxSQL Server 2008 Learning Portalhttp://www.microsoft.com/learning/sql/2008/default.mspx

• Connect: Local Chapters, Special Interest Groups, Online Community• Share: PASSPort Social Networking, Community Connection Event• Learn: PASS Summit Annual Conference, Technical Articles, Webcasts

• More about the PASS organization www.sqlpass.org/

The Professional Association for SQL Server (PASS) is an independent, not-for-profit association, dedicated to supporting, educating, and promoting the Microsoft SQL Server community.

Page 30: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

Complete a session evaluation and enter to win!

10 pairs of MP3 sunglasses to be won

Page 31: Paul Filmalter PFE Microsoft DAT313 Agenda Setting the Scene What’s New In Database Mirroring in SQL Server 2008 Tips and Tricks Summary

© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS,

IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.